Maven Tycho fails as it tries to unzip a signature file (tycho-packaging-plugin) - maven

I am building an Xtext project with Maven+Tycho. mvn clean install completes successfully, mvn deploy completes successfully as well, but mvn clean install deploy fails with:
[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-packaging-plugin:1.4.0:package-feature
(default-package-feature) on project protelis.parser.feature:
Execution default-package-feature of goal
org.eclipse.tycho:tycho-packaging-plugin:1.4.0:package-feature failed:
Could not determine installation size of file
/.../protelis.parser/target/protelis.parser-8.1.0.pom.asc:
error in opening zip file -> [Help 1]
(newlines mine, to ease reading)
It looks to me that some plugin Maven is trying to use a signature file as if were a compressed zip file, and fails.
I probably can work this around by running mvn clean install && mvn clean deploy, but I'd like to investigate, understand the root cause, and fix this for good.
Here is a link to the failing project, for pom.xml inspection.

Related

Maven - jenkins pipeline not using pom

I have a problem running a maven deploy through Jenkins. When run locally, the correct URL is contacted, but via Jenkins(in the middle of a pipeline), it does not. It also states that it is using a different plugin to do so. How do I get Jenkins to contact MY_URL like my command line does?
(I've cleaned up the output a bit)
Running the following through the command line gives me:
mvn clean deploy -DaltDeploymentRepository=nexus::default::https://MY_URL/ -DskipTests -P nexus -X -s ./settings.xml
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project MY_PROJECT: Failed to deploy artifacts: Could not transfer artifact from/to nexus (https://MY_URL): Failed to transfer file 20200217.092316-15.jar with status code 401 -> [Help 1]
This is what I want (I'm waiting on credentials - but it is hitting the correct URL)
Running via Jenkins gives me:
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.5.1:deploy (default-deploy) on project : Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
I have done a "diff" on the pom files in use by jenkins and locally and they are identical; likewise with the settings.xml I suspect this is a plugin problem but do not know where to go with it.
Items I have tried:
mvn clean beforehand
reinstalling mvn
echoing the settings.xml and pom.xml into the jenkins output
Specifying altDeploymentRepository in the settings.xml and/or
commandline
Specifying altDeploymentRepository using the -Dproperties= flag
Combinations of altDeploymentRepository, altDeploymentDirectory,
altSnapshotDeploymentRepository
Endless research
Hopeful reruns
Banging head on desk
Your Jenkins runs the org.sonatype.plugins:nexus-staging-maven-plugin:1.5.1:deploy goal.
It is either specified in the POM or given on command line. So first of all, check whether the nexus-staging-maven-plugin is configured in your POM or in one of the parent POMs. If so, check if it run conditionally or is part of a profile.
Secondly, look at the command line call in Jenkins and see if it is exactly the same as the one you ran locally.
The third possibility is that you run a Jenkins plugin from Sonatype that implicitly tries to deploy artifacts. So watch out for Sonatype specific Jenkins plugins.
One of the three strategies should lead to the source of the problem.

Maven Build gets Failed saying Could not assemble p2 repository: Mirroring failed: No repository found at

I have a maven build for building an eclipse plugin which gets hung sporadically during the execution of
--- tycho-p2-repository-plugin:1.1.0:assemble-repository (default-assemble-repository) # com.sample.product ---
Otherwise the build will get failed saying the following error.
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-repository-plugin:1.1.0:assemble-repository (default-assemble-repository) on project p2:Could not assemble p2 repository: Mirroring failed: No repository found at file:/C:/Users/obuli/.m2/repository/.
I am using the following maven goals and options
clean deploy -Dtycho.localArtifacts=ignore
I have searched for this issue and landed on this Bug , It says there was a bug in tycho 0.26.0 But I am currently using Tycho version 1.1.0
Since the issue is very sporadic I could not able to identify the root cause. Please let me what I am missing here.
I intermittently had this problem as well. After running mvn clean and mvn deploy separately once, mvn clean deploy started working as well.
Now I don't seem to be able to recreate the original issue, even using git clean -xfd and deleting all snapshots from the local and remote repository.
I can only guess that there were some leftover files from earlier builds which were not cleaned by mvn clean deploy but by mvn clean, and these leftover files must have broken the build.

On adding a jar using mvn install: install-file: On project standalone-pom: The artifact information is incomplete or not valid

I want to push the bahir jar to my local m2 repository.
I'm using maven-3.5.0 downloaded tar.gz and jdk8, both are set as environment variables and are working fine.
I built apache bahir for spark from the available download from git using maven, which was BUILD SUCCESS and it created a target folder which has the jar called bahir-parent_2.11-2.3.0-SNAPSHOT-tests.jar
now when I execute:
$mvn install:install-file -Dfile=/home/awisha/trial/bahir-master/target/bahir-parent_2.11-2.3.0-SNAPSHOT-tests.jar -DgroupId=org.apache.bahir -DartifactId=spark-streaming-mqtt_2.11 -Dversion=2.2.0
Its supposed to push the jar to my local .m2/repository. But instead it gives me the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: The artifact information is incomplete or not valid:
[ERROR] [0] 'packaging' is missing.
But when I used "apt install maven" : maven-3.3.9, I got BUILD SUCCESS
I'm not able to figure out why is it giving me error when using maven-3.5.0.
You need to simply add "-Dpackaging=jar" to your mvn install:install-file cmd:
$mvn install:install-file -Dpackage=jar
-Dfile=/home/awisha/trial/bahir-master/target/bahir-parent_2.11-2.3.0-SNAPSHOT-tests.jar
-DgroupId=org.apache.bahir -DartifactId=spark-streaming-mqtt_2.11 -Dversion=2.2.0

Is there an Docker Maven Plugin in jar file?

Just a quick inquiry to see if there are any .jar files for docker - maven plugin that can be directly installed in Apache Maven using the mvn install command.
I was trying to run a docker-maven plugin using a pom file on windows but was getting the following error:
[ERROR] Failed to parse plugin descriptor for
org.codehaus.plexus:plexus-compone nt-metadata:1.6
(C:\Users\user2.m2\repository\org\codehaus\plexus\plexus-com
ponent-metadata\1.6\plexus-component-metadata-1.6.jar): error in
opening zip file -> [Help 1]
I have installed plexus-component-metadata-1.6.jar and plexus-component-metadata-1.6.pom but it is not working..
Any help please..??
This error can occur when your connection gets interrupted during your dependencies are being downloaded last time.
Delete the relevant repository folder and run mvn clean install command again to download a fresh copy of corrupted file.

False compile error during mvn release:perform says invalid pom while pom is fine and code compiles

While trying to release new version of our-test-tools project I get:
1. Warning on invalid POM
[WARNING] The POM for org.synyx.hades:org.synyx.hades:jar:1.6.3.RELEASE-2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
2. Compilation error
COMPILATION ERROR: [...] package org.springframework.jdbc.datasource
does not exist
However!
There's no compile error in our-test-tools and synyx's POM is valid.
Following works (Maven reports success):
mvn install also with -o on project I'm trying to release
mvn release:prepare
mvn install on checked out project (check out done by mvn release:perform itself)
mvn verify or mvn help:effective-pom on synyx project
Following did not help:
cleaning local repository
updating dependent project to make preferred Maven profile active
-e and -X switches - I found no clues
Any ideas what can be wrong or what can I try?
Further info:
SCM = Git.
**our-test-tools* project POM: http://pastebin.com/vkaXshhL

Resources