How to fix Missing requirement for javax.imageio while building Eclipse-CDT using Maven? - eclipse

I downloaded the eclipse cdt source package org.eclipse.cdt-CDT_9_8_1.tar.xz from https://git.eclipse.org/c/cdt/org.eclipse.cdt.git and using maven 3.6.1 i tried to build it with command mvn clean install. Some packages were downloaded from repos and at the end it exited with the below error message
I need to build cdt from source as i want some changes in CDT source code. I am not an expert in Maven, not sure what's going wrong. Please help to resolve the issue
[INFO] Resolving dependencies of MavenProject: org.eclipse.cdt:org.eclipse.cdt.build.gcc.core:1.0.1-SNAPSHOT # D:\Eclipse\Sources\CDT9.8.1_GIT\cdt-releng\org.eclipse.cdt\build\org.eclipse.cdt.build.gcc.core.polyglot.build.properties
[ERROR] Cannot resolve target definition:
[ERROR] Software being installed: com.sun.xml.bind 2.2.0.v201505121915
[ERROR] Missing requirement: com.sun.xml.bind 2.2.0.v201505121915 requires 'java.package; javax.imageio 0.0.0' but it could not be found
[ERROR] Failed to resolve target definition D:\Eclipse\Sources\CDT9.8.1_GIT\cdt-releng\org.eclipse.cdt\releng\org.eclipse.cdt.target\cdt.target: See log for details -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException

The issue here is, that some plugins do not define a RequiredExecutionEnvironment. If such a plugin depends on a JRE package the build fails with the given error.
In Tycho it is possible to define such an environment:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<!-- needed as some plugins do not set a execution environment they would fail to get jre packages (eg. javax.imageio) -->
<executionEnvironment>JavaSE-1.8</executionEnvironment>
</configuration>
</plugin>

Related

kie-maven-plugin:7.36.1.Final Plugin extension dependency error using Maven

Migrating Drools from 6.5.0.Final to Drools 7.36.1.Final , I am facing issue in resolving org.kie:kie-maven-plugin:7.36.0.Final dependency issue as below
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.kie:kie-maven-plugin:7.36.0.Final or one of its dependencies could not be resolved: The following artifacts could not be resolved: xmlpull:xmlpull:jar:1.2.0, xpp3:xpp3_min:jar:1.2.0: Could not find artifact xmlpull:xmlpull:jar:1.2.0
POM entry
<plugin>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>7.36.1.Final</version>
<extensions>true</extensions>
</plugin>
Hi same problem with versions higher than 7.31.
Since they changed the dependencies in kie-parent.pom
from
<version.xmlpull>1.1.3.1</version.xmlpull>
<version.xmlunit>1.3</version.xmlunit>
<version.xpp3>1.1.4c</version.xpp3>
to
<version.xmlpull>1.2.0</version.xmlpull>
<version.xmlunit>1.3</version.xmlunit>
<version.xpp3>${version.xmlpull}</version.xpp3>
I try lot of tricks and can't solve the problem yet.
1.2.0 it's an ea version located in https://repository.jboss.org/nexus/content/repositories/ea/.
It can be found at: https://mvnrepository.com/artifact/xmlpull/xmlpull/1.2.0. I have no clue why it is not listed here: https://mvnrepository.com/artifact/xmlpull/xmlpull so maven can resolve it.
you can download it and put it into your local m2 repository or into your company maven repository like nexus or artifactory.
You need to add one of those repo-s in your build, so maven can find it:
https://mvnrepository.com/repos/jboss-ea
https://mvnrepository.com/repos/jboss-thirdparty-releases

Class library resolving error in endpoints-framework:discoveryDocs

I am trying to migrate my project from endpoints v1 to endpoints v2 but cannot create discovery docs. running
$ mvn -DskipTests -X endpoints-framework:discoveryDocs
leads to a build failure
[ERROR] Failed to execute goal com.google.cloud.tools:endpoints-framework-maven-plugin:1.0.0:discoveryDocs (default-cli) on project myproject: Execution default-cli of goal com.google.cloud.tools:endpoints-framework-maven-plugin:1.0.0:discoveryDocs failed: A required class was missing while executing com.google.cloud.tools:endpoints-framework-maven-plugin:1.0.0:discoveryDocs: org/apache/commons/dbutils/ResultSetHandler
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.google.cloud.tools:endpoints-framework-maven-plugin:1.0.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/me/.m2/repository/com/google/cloud/tools/endpoints-framework-maven-plugin/1.0.0/endpoints-framework-maven-plugin-1.0.0.jar
[ERROR] urls[1] = file:/Users/me/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
...
I can see that the respective .jar file is in the -cp parameters:
..., /Users/me/.m2/repository/commons-dbutils/commons-dbutils/1.6/commons-dbutils-1.6.jar, ...
but not in the error urls (urls[0..48] = ...)
Building and testing runs correctly (mvn verify etc), so the libraries do actually exist and work, but I think it cannot actually run without discovery docs.
Any ideas what I could have missed? There seem to be a huge number of .jar files in that classpath, is there some limit?
You have to update the endpoints-framework-maven-plugin to version 1.0.1:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>endpoints-framework-maven-plugin</artifactId>
<version>1.0.1</version>
<configuration>
<!-- plugin configuration -->
<hostname>YOUR-APPP-ID.appspot.com</hostname>
</configuration>
</plugin>
There was a bug in version 1.0.0, see here:
https://github.com/GoogleCloudPlatform/endpoints-framework-maven-plugin/issues/32

maven could not resolve project dependencies?

When i try to make a mvn deploy i am getting this error:
[ERROR] Failed to execute goal on project cross-automation-config: Could not resolve dependencies for project com.desp.cross.commons:cross-automation-config:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [com.desp.qc:automation-commons-config:jar:0.0.7 (compile), com.desp.cross.commons:cross-automation-utils:jar:0.0.1-SNAPSHOT (compile)]: Failed to read artifact descriptor for com.desp.cross.commons:cross-automation-utils:jar:0.0.1-SNAPSHOT: Failure to find com.desp.cross.commons:cross-automation-commons:pom:0.0.1-SNAPSHOT in http://repo.jenkins-ci.org/public/ was cached in the local repository, resolution will not be reattempted until the update interval of repo.jenkins-ci.org has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Into the project (cross-automation-config) i have these dependencies
<dependency>
<groupId>com.desp.qc</groupId>
<artifactId>automation-commons-config</artifactId>
</dependency>
<dependency>
<groupId>com.desp.cross.commons</groupId>
<artifactId>cross-automation-utils</artifactId>
</dependency>
This project has a parent project, which i don't considerate necessary to put in here.
I know that this is a dependencies problem. What i don't understand is why eclipse can download those dependencies, without any error, and maven can not
Do you have an idea about what is going on?
It looks like your maven is not able to find this dependencies in your local repository.
You should try to build first those two projects: automation-commons-config and cross-automation-utils (be careful if there are dependent in each other).

Trouble with the sonar-packaging-maven-plugin after refactoring

I have some trouble developing a plugin for my company, later called as "myPlugin".
Background:
I was reading the book "SonarQube in Action" by the Manning company.
There was a little guide for developing a own plugin (they used the redmine plugin as example for developing). It told me to use the sonar-plugin-archetype to create the basic framework.
Situation before refactoring:
I wrote the plugin and it works fine. I encountered the problem when I've done some refactoring. Before the refactoring every package in the src folder in my tree (using ecplise) was called "main.java.org.sonar.plugins.myplugin" but the package decleration within each class was "org.sonar.plugins.myplugin". This were default settings created by using the sonar-plugin-archetype.
The settings within the pom.xml of the sonar-packaging-maven-plugin were the following once.
Pom-snippet before any changes were done:
<plugin>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-packaging-maven-plugin</artifactId>
<version>1.9</version>
<extensions>true</extensions>
<configuration>
<pluginClass>org.sonar.plugins.myplugin.myPlugin</pluginClass>
</configuration>
</plugin>
So far everything worked fine. Now we come to my problem.
Situation after refactoring:
As my company has some naming conevtions for classes and packages i changed the package names in the tree to "com.mycompany.sonar.plugins.myplugin" and the package decleration within each class also to "com.mycompany.sonar.plugins.myplugin". Then i changed the classPath option for the sonar-packaging-maven-plugin to "com.mycompany.sonar.plugins.myplugin.myPlugin". All I've done so to say was changing "org." into "com.mycompany.".
Pom-snippet after changes were done:
<plugin>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-packaging-maven-plugin</artifactId>
<version>1.9</version>
<extensions>true</extensions>
<configuration>
<pluginClass>com.mycompany.sonar.plugins.myplugin.myPlugin</pluginClass>
</configuration>
</plugin>
When i was running the "compile" command everything worked. Using "package" does not work, because the sonar-packaging-maven-plugin was not able to find the given class (see console output below). When i'm refoactoring everything again back to the beginning it works again.
[...]
[INFO] --- sonar-packaging-maven-plugin:1.9:sonar-plugin (default-sonar-plugin) # sonar-projectkeychecker-plugin ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.649 s
[INFO] Finished at: 2014-04-02T11:42:01+01:00
[INFO] Final Memory: 13M/67M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.sonar:sonar-packaging-maven-plugin:1.9:sonar-plugin (default-sonar-plugin) on project sonar-myplugin-plugin: Plugin class not found: 'com.mycompany.sonar.plugins.myplugin.myPlugin-> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
My Question: Why are my new names not working? Are there any inner convetions for the sonar-packaging-maven-plugin (like the packaging name has to beginn with "org.sonar" ot something like this)?
Thank you for reading this long text and your try to help me :)
pluginClass is the entry point of the plugin. Value must be an existing class. In your example I suppose that there's a typo, it should be com.mycompany.sonar.plugins.myplugin.MyPlugin (upper-case M).
Under <plugin> I was missing the <extensions>true</extensions> tag

Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1:war - Could not copy resource

I have a multi-module project that I'm trying to import in my Ubuntu 12.04 LTS's Eclipse Juno. (I already have done it successfully on Windows 7).
My project has six modules, the first four modules are successfully imported from the SVN Repository and built with Maven 3.0.5, but when I try to build the fifth called core, i receive the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1:war (default-war) on project core: Could not copy resource [/opt/workspace/core/target\preassembly]: File /opt/workspace/core/target\preassembly/scripts/Mask.js does not exist -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
As the error says, It looks like that Maven can't find the directory /opt/workspace/core/target\preassembly to copy the file /opt/workspace/core/target\preassembly/scripts/Mask.js.
But, this directory actually exists and the file Mask.js is in there. What looks strange to me is that backslash \ after target directory instead a common bar /. But I have no idea if this is a problem and how to solve it, I spent 2 days researching the Internet but unfortunately I've found nothing.
Here's my maven-war-plugin configuration section of parent project's pom.xml, where the backslashes appear
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
<webResources>
<resource>
<directory>${project.build.directory}\preassembly</directory>
</resource>
</webResources>
</configuration>
</plugin>
I've also checked the owner of the directories on Ubuntu, and everything refers to the same owner that worked on the first four modules.
As I said above, the same version of eclipse, svn and maven works great on Windows.
Anyone ever had this problem? Thank you very much.
I was working on angular 8 and updated the code to angular 9 and then during build i got the same issue .For me clean build solved the issue.You can try clean build , hope that will help .