Maven Assembly error : no entry name specified - maven

In fact this is not a question because I've already found the solution but I've strugguled so long with it that I'd rather share this one with you than let it die in the depth of my mind
This problem occured to me on an existing project that was using maven assembly 2.2 for some time
The whole exception message was :
Failed to execute goal
org.apache.maven.plugins:maven-assembly-plugin:2.2:assembly
(default-cli) on project
test: Failed to create
assembly: Error creating assembly
archive jar-with-dependencies: Problem
creating jar: no entry name specified
There was no more message even with a mvn -X
At the beginnig I thought it was due to a bad url like :
jar:file://MY_FILE.jar!
But all this was caused by an hidden file named ".#log4j.xml..." which was automatically created by CVS during a conflict resolution
==> solution is resolve the conflict and remove the file
I've filed a bug report on this : PLXCOMP-169

As I said this is not a bug and will need an improvment from the plexus team.
Until then you will need to find by yourselves ".#" files in your project AND dependencies (this one was in a project of mine which was a dependency to the project beeing assembled).
Thanks to Jon to point me out the fact that an accepted answer would be more intuitive.

Related

NuGet hash validation failed NU1403

I have a solution and it working on other developer's laptops, but on one by some reason during build, I see the next error:
Error NU1403 Package content hash validation failed for
Lucene.Net.Contrib.3.0.3. The package is different than the last
restore.
build is failed by this reason.
at packeges folder I see correct Lucene.Net.Contrib.3.0.3 , what could be a reson for it and how to fix ?
clean up the global packaged folder fixed this issue.
path is %userprofile%.nuget\packages

Adding Maven Dependencies to Ant

I'm trying to implement adding maven dependencies to my ant build using this article. I beleive I have everything set up as indicated by the article but since it is not working I must be missing something. I am getting this error:
Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.
My searches for this error seem to imply I an missing maven-ant-tasks-2.1.3.jar. However, it is in the path indicated by the classpath. Can someone help be debug this? TIA.
I found at least part of the problem. I had the wrong file name in the classpath. It was maven-ant-tasks.jar and it should have been maven-ant-tasks-2.1.3.jar.
Unfortunately I now have a different problem which I think implies a corrupt jar file.
Unable to obtain resource from /usr/build/lib/maven-ant-tasks-2.1.3.jar: java.util.zip.ZipException: error in opening zip file
Downloading the jar file again did not help.
Never mind. Apparently the Apache maven web site has a corrupt version. I downloaded it from the mvnrepository and that worked.

Unable to build maven project, pom.xml file not found

We recently lost (i.e they died after SAN failure) build VMs for an inhouse application. Unfortunately, these VMs were never backed up.
The devs that set this environment up have moved on and now I'm trying get these VMs going again as mods are required to this inhouse application. I'm a sys admin not a developer and this is proving harder than I thought...
The VMs that died were a TeamCity server and an Artifactory server.
I've built a new VM with both TeamCity and Artifactory (it should be lightly loaded enough to handle it). I have TeamCity talking to the git repo but when I try and build the project, I get
Non-readable POM /srv/teamcity/10.0.4/buildAgent/work/b20d5a085d491430/webview/pom.xml: /srv/teamcity/10.0.4/buildAgent/work/b20d5a085d491430/webview/pom.xml (No such file or directory)
Looking on the file system, indeed there is no pom.xml file at /srv/teamcity/10.0.4/buildAgent/work/b20d5a085d491430/webview. There is however a pom.xml file in /srv/teamcity/10.0.4/buildAgent/work/b20d5a085d491430.
Any pointers on how to get Maven to look one directory up for this file?
Thanks
Edit:
Apologies all, I just found that I hadn't correctly defined the "VCS Root", I done that now and am getting further although the project still doesn't build. I'll poke it some more and see how I go.
I just found that I hadn't correctly defined the "VCS Root".
I faced similar issue. Solution is: Please check the module name in parent POM and child pom, both name should be same.
Adding to that Teamcity build using maven thrown me same kind of error with the below message
The project (/opt/buildagent/work/d1df6864f98d2599/pom.xml) has 1 error
Non-readable POM /opt/buildagent/work/d1df6864f98d2599/pom.xml: /opt/buildagent/work/d1df6864f98d2599/pom.xml (No such file or directory)
for me it solved by creating VCSRoot configuration

Tycho missing plugin when building an update site

When I build my project by tycho-maven-plugin, I encounter the following message:
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: foo-updatesite raw:0.2.0.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):0.2.0-SNAPSHOT
[ERROR] Missing requirement for filter properties ~= $0: foo-feature.feature.group 0.2.0.qualifier requires 'foo-plugin 0.0.0' but it could not be found
[ERROR] Cannot satisfy dependency: foo-updatesite raw:0.2.0.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):0.2.0-SNAPSHOT depends on: foo-feature.feature.group [0.2.0,0.2.1)
This error occurs when building an update site. Plugin and feature are build normally. I build the update site from PDE without issues.
The project structure is common: there is a parent project with pom packaging and three modules: plugin, feature and updatesite. Of course, I invoke mvn clean package from the parent project.
What can be the reason for this error? How can I debug it?
UPD: I tried many things: removed "grandparent" pom, removed SNAPSHOT/qualifier, played with configuration. However, I found the solution: I switched to tycho 0.19 instead of 0.21. So I suppose there is a bug in tycho 0.21.
The error message
Missing requirement for filter properties ~= $0
indicates that you have defined an environment filter when you include the plugin foo-plugin in the feature.xml. However this does not explain the dependency resolution error you are seeing. The only way I can reproduce the error message is by adding an Eclipse-PlatformFilter header in the manifest of the plugin using a value which doesn't match environments configuration in the POM.
I had the same error message:
Missing requirement for filter properties ~= $0: foo-feature.feature.group 0.2.0.qualifier requires 'foo-plugin 0.0.0' but it could not be found
For some reason this error (also) means, that foo-plugin is present... twice.
So in your case, open the "Content" tab of the "Target Editor" and make sure that foo-plugin is not present in two distinct versions. I common way this could happen is if two features contain the same bundle.

tycho-p2-repository-plugin fails with "No content specified for p2 repository"

I am trying to build a p2 repository using Tycho and the tycho-p2-repository-plugin in an eclipse-repository packaging type. When I run the build, it is giving me the following exception:
Failed to execute goal org.eclipse.tycho:tycho-p2-repository-plugin:0.13.0:assemble-repository (default-assemble-repository) on project com.mycompany: No content specified for p2 repository
Can someone point me to the cause of this problem?
You need either of the following files in the root of the eclipse-repository project:
A category.xml files with at least one feature referenced in it
A *.product file
These files define what should be included in the p2 repository, so if there is none of these, the p2 repository would be empty. This is probably not what you wanted, so Tycho fails the build. (Admittedly, the error message could be more helpful...)
I had this problem too, unfortunately it was one of many problems and I do not remember which thing I did to fix it.
Make sure you are using 0.14.1 of tycho.
My working version is a very empty pom.xml, much like Packaging Types
I have not needed to configure the eclipse-repository via tycho-p2-repository-plugin.
Do you have a valid target definition defined in your reactor build somewhere?
Is your *.product file valid? The product file needs to be in the same directory as your eclipse-repository pom, I think it gets found via black magic.
Also make sure your product feature is separate from your eclipse-repository.
under PDE builds you could have the *.product file and the with the feature that is the root for your product.

Resources