I am developing a binding for the smart home platform openHAB. As mentioned in the docs, I forked the main project and created a new branch and imported the new related project (see picture of my IDE below, the project with the "X").
I was surprised that my new project was creating some errors, which seem to be related to maven. I have no idea where to look to solve this issue.
UPDATE: due to some advice I used my systems maven version and the logs are telling me, that this is probably the main problem:
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] 'modules.module[181]' specifies duplicate child module org.openhab.binding.cus # org.openhab.binding:pom:[unknown-version], E:\joba\workspace-openhab\OpenHabAddonDev\openhab-master\git\openhab2-addons\addons\binding\pom.xml, line 201, column 13
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:383)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects (DefaultGraphBuilder.java:414)
These are issues related to m2e (The Maven plugin in Eclipse). It tries to mimick Maven which does not work for not-so-standard Maven plugins. Usually, you can repair this by setting the policy to "ignore".
Related
In a Jenkins CI job, a single module of a multi-module Maven project is checked out from svn and the following Maven goals are specified:
clean verify pmd:pmd
The build fails with the error message
org.apache.maven.project.ProjectBuildingException: Some problems were
encountered while processing the POMs: [ERROR]
'dependencies.dependency.version' for org.jdom:jdom2:jar is missing. #
line 162, column 21
The missing version is only specified in the main (master) pom, which was not checked out.
To fix this I can check out the whole multi-module project, but are there other options which limit the check-out to only the required files - the master pom.xml and the module?
Additional information: the build worked well in the past, with many other dependency versions which were not specified in the module. All these artefacts were already in the local .m2 repository. Now with a new dependency this error occurs. I guess that it has something to do how Maven handles version matching when artefacts are already installed.
Jenkins offers to perform more than one check-out operation for a Maven build job. In the first one I specifiy the path to main (master) project, and set repository depth to "files". The second contains the module to-be-verified.
We have a case where there are multiple projects configured in sonar. All the project have different modules with same names.
With this, as and when we execute sonar for one of the project, the execution is getting terminated with below error.
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project XXX: Module "XXXX" is already part of project "YYYY" -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project XXXX: Module "YYYY" is already part of project "YYYY"
It seems that because the module name is same , Sonar is terminating the execution. Note that we are using sonar version 4.5.5 and facing this issue. While earlier we were using sonar version 4.1.1 and with that version the execution was successful (probably sonar was overriding earlier report with the newer one in case of conflicting module name).
Please suggest possible solution for this? Thanks,
Complete error log is available here
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/sonarqube/-L7cby77-28/6L6zPlb6AAAJ
I think you need to rename you modules like if your project is abc.
Please change your modules like abc_xxx etc...it may work for you
Have you tried using the project name property?
In a pom.xml file:
<sonar.projectName>Some project name here</sonar.projectName>
I have a Java project where I want to make some calls to a Jung library. I added the following lines to the pom.xml
net.sf.jung
jung-algorithms
2.0.1
However when I run "mvn package", I get the following error
[ERROR] Failed to execute goal licensing-maven-plugin:1.
7.5:check (enforce-licensing-oss) on project server-examples: This project
has 3 disliked artifacts. -> [Help 1]
Any insights as to what may be going wrong ?
You have configured the licensing-maven-plugin to complain when you introduce a dependency with certain licenses. You, or whoever wrote your pom. If you read the configuration for that plugin it will tell you what licenses it is configured to like and dislike.
My build is failing with this error message (corporate stuff crossed out):
[ERROR] Failed to execute goal on project XXXX: Could not resolve
dependencies for project XXXX: The following artifacts could not be
resolved:
com.github.chrisbanes.actionbarpulltorefresh:library:jar:0.9.3,
com.github.castorflex.smoothprogressbar:library:jar:0.2.0: Cannot
access XXXX-release (http://repo.XXXX.corp/main/repo) in offline mode
and the artifact
com.github.chrisbanes.actionbarpulltorefresh:library:jar:0.9.3 has not
been downloaded from it before. -> [Help 1]
The funny thing is that actionbarpulltorefresh is not a dependency of this project. I double-checked and the string appears nowhere in the directory. It's a dependency of another project I built a couple of days ago, but not this one. It's also not mentioned in my users's settings.xml file, or anywhere in .m2 except that it's actually installed there.
Where could that error possibly be coming from?
It might be a transitive dependency, a dependency of a dependency.
This question might help you: How to determine which Maven dependency is needing a missing dependency?
Background:
I am developing Maven multi module project.
One of the module is common module needed by other all modules.
This module contain CommonClassA.java.
common module is properly compiled.
It is installed into maven local repository properly.
One of the class(Billtype.java) in other module (EmployeeBilling) refers this class(CommonClassA.java).
Maven Dependency for common module is properly specified in pom.xml of EmployeeBilling module.
Problem:
While compiling EmployeeBilling module it throws
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project EmployeeBilling: Compilation failure
[ERROR] \MyWorkspace\Biz\EmployeeBilling\src\main\java\com\employee\Billtype.java:[79,19] error: cannot access CommonClassA
[ERROR] -> [Help 1]**
Supporting details:
dependency defined in EmployeeBilling> pom.xml:
Other classes from common module seems accessible as no error observed
There are no other errors like Class not found/file not found.
The class CommonCLassA implements Serializable
Same error occurs from Eclipse as well as commond line
I am using M2E plugin
Tools:
jdk1.7.0_02
OS: Windows 7
Eclipse JUNO and apache-maven-3.1.0
Thanks in advance!
If project builds properly using eclipse compiler then it should work with Maven.
Few things to check if its not working with maven:
Manually check in repository that jar is installed properly and it contains your class file.
Try to build project using locally installed Maven instead of maven in eclipse.
Set -DskipTest=true while installing your jar, as it can cause issues at times.
If these steps don't work then show us your pom.
With no more information it's hard to find the cause. But I also had this problems now and then, and there are some things which could go wrong:
Are you using the right JAVA version (everywhere) ?
... and the right java PROVIDER? (Oracle, IBM, OpenJDK) In my case it's often this issue, I'm sometimes bound to IBM JDK, although I try to use Oracle where I can and this sometimes breaks my build.
Is the right maven dependency VERSION used? If you depend on it multiple times, and all in the same (lower than root) dept of dependencies, Maven will just "choose" a version. It could be that thát version is incompatible with your code of thát particular dependency
Skipping tests sometimes WORKS! It has something to do with maven phases and getting stuff ready for using it elsewhere.
Good luck :)
I had the same problem. Even the jar dependency has the required class files. Finally I deleted the local maven repo and restarted the build. Now it worked without any issue.
It looks like you are using an old version of maven-compiler-plugin (v2.3.2).
I suggest you upgrade it to 3.x. it won't magically fix your issue but it will definitely give you better / more detailed error message.