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

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.

Related

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

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.

Maven: is there a simple command to test repository access?

Some of my users have trouble accessing our local Nexus repository. Some of them are somewhat newbies in maven configuration. Sure they can test if everything is downloading fine running mvn install, but I'd like to help them to isolate their environment problems.
Is there a simple mvn command just to test if the repository access is correctly configured?
Use
mvn help:effective-settings
A simple
mvn clean
test the repository access.
I had a number of dependencies that failed to download from the Maven Central repository (apparently due to network throttling/flakiness). Running "mvn clean" just immediately returned with the same errors, obviously not attempting any more downloads. But its message said to rerun with "-x" option to see the full stack trace, so I ran:
mvn clean -x
This caused it to retry and download more. It took several tries to get all dependencies downloaded, but it did eventually run to completion. It didn't give me any stack traces, and I still don't know what was causing the failures (the repository was reachable the whole time).

Maven cannot get artifact from my local repository

Trying to get the follwing JAR from my local/internal repository:
httpclient-4.3.1.jar
Maven fails with Error:
ArtifactDescriptionException: Failed to read artifact descriptor for org.apache.....
It works fine with every single other jar but it fails on this apache one. No idea why. Tried clearing .m2\repository, upgrading Maven, eclipse, re-uploading, nothing worked.
Try mvn -U clean install command.
It checks for updates and releases and snapshots on remote repository."-U" forces to check the updates.

project module are getting skipped in night build configuration

Kindly note: "I have edited this question"
I am observing a very strange situation. I have 2 jobs configured in Jenkins having same configuration except that one of them is continuous build and another is nightly build [ poll scm configured #midnight] with Sonarqube configuration to generate report.
Both builds have same Repository URL and Both of them are having build result success. But in continuous build, every modules is analysed and then getting success. whereas in nightly build, modules are skipped.
what my question is same build is running fine for continuous build and not for nightly. so what could be cause of this ?
Earlier i was using -DskipTests which was analysing all module and getting successful in continuous build.. but was skipping in nightly build.
so i refered this link Maven skip tests and added -Dmaven.test.skip=true in maven goals.. and now some of the modules are analysed and getting success. But one fo the module got failed and due to which other modules got skipped. below is the error log
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
(default-test) on project ASData: There are test failures.
Note: I am using maven 3.3.1 version and SonarQube 5.1
I am still not allowed to add comments so I will ask here.
Where do you keep the modules and can you guarantee that noone will severe the connection between your build and the storage of modules?

tycho-p2-publisher-plugin fails on build with maven-release-plugin

I am using the tycho-p2-publisher-plugin in order to create a p2 site which can be uploaded to Nexus as described at Tool for managing/hosting own p2 repositories? - it aimed to be a work-around for the fact that Nexus does not seem to support hosted p2 repositories.
My problem is: the p2 artifacts are created fine and are even uploaded to Nexus whenever I do a snapshot build. However, when I try a release build, the build fails because of
[INFO] INFORMATION: I/O exception (java.io.FileNotFoundException) caught when processing request: /home/hudson/jobs/jobname/workspace/our.component.build/target/checkout/our.component.repository/target/p2content.xml
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project our.component.repository: Failed to deploy artifacts: Could not transfer artifact our.component:our.component.repository:xml:p2metadata:1.1.18 from/to releases (http://192.168.205.205:8081/nexus/content/repositories/releases): /home/hudson/jobs/jobname/workspace/thirdparty/our.component.build/target/checkout/our.component.repository/target/p2content.xml (Datei oder Verzeichnis nicht gefunden) -> [Help 1]
p2content.xml is not found, simply because it's not there. The question is, should it be there?
I am using the maven release plugin, and as far as I understand, during the release build process, all components are prepared, then checked in and tagged with the release version. After that, they are checked back out from the tag, and then the build is started. As obviously the release build is run for the checkout folder (as seen above: .../target/checkout/...), the problem seems to be that p2context.xml is created by the tycho-p2-publisher-plugin during the build, but not checked in, while later it is expected to appear in the checkout folder. I would guess that Maven should not expect the file there and try to deploy it to Nexus, but I fail to understand why is it expected to be there? And what's the right approach to cure my release build?

Resources