Maven artifact of same project failed - maven

I have a Maven project with following structure
/app
/- pom.xml
/- app-api
/- pom.xml
/- app-impl
/- pom.xml
There are some external dependencies, but when I tried to build the project Maven failed while trying to retrieve app-api from external source with error
[ERROR] Failed to execute goal on project app-impl: Could not resolve
dependencies for project com.examp:app-impl:jar:0.0.0.1: Could not
transfer artifact com.example:app-api:jar:0.0.0.1 from/to
nexus-snapshot (http://example.com/repository/snapshot): Failed to
transfer file:
http://example.com/repository/snapshot/com/example/app-api/0.0.0.1/app-api-0.0.0.1.jar.
Return code is: 400 , ReasonPhrase:Bad Request. -> [Help 1]
The snapshot repository policies forbid 4 digit version. But I cannot understand why Maven does not associate that dependency locally.

If the desired artifact is in your local repository (.m2/repository), Maven should find it there (without looking in remote repositories).
Otherwise, have a look at your settings.xml and see whether you misconfigured your repositories.

Related

Q: “the pom for XXX is missing, no dependency information available”,but the dependency is already in the Nexus repository

while running mvn packaging, there is a warming shown in log.
[WARNING] The POM for com.yueyue:order-search-interface:jar:1.2.1.SNAPSHOT is missing, no dependency information available
and the compiling is failed in the end with the error as following.
[ERROR] Failed to execute goal on project dispatch-admin: Could not resolve dependencies for project com.yueyue:dispatch-admin:jar:2.0.0-SNAPSHOT: Could not find artifact com.yueyue:order-search-interface:jar:1.2.1.SNAPSHOT in bailongma_repo2 (http://192.168.200.224:8081/repository/bailongma_repo2/) -> [Help 1]
but the dependency is already in the maven-snapshots which is in the "bailongma_repo2" group repo.
by the way, this dependency is also in a remote repo which is as a proxy repo "aliyun_snapshot2" in "bailongma_repo2" group repo. the structure of "bailongma_repo2" group repo is as following.
what should i check first for this problem? many thanks in advance!

Jenkins Offline cannot able to resolve Maven Dependencies

I am trying to Build a Maven Project from Jenkins.
My server is Offline, so no Internet access or no proxy settings.
Maven Project Build absolutely perfect from Jenkins if Internet is present.
But same project fails to Build from Jenkins in absence of Internet. My repo is containing this plugin.
My Maven Home:/home/oracle/app/Trust/maven
My Jenkin Home:/home/oracle/.jenkins/
.m2 file Location:/home/oracle/.m2
Error: [ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: The repository system is offline but the artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 is not available in the local repository. -> [Help 1]

Spring Batch Admin ... Problems Building 1.3.0 RELEASE

I pulled the latest Spring Batch Admin-1.3.0-RELEASE and am trying to build and deploy. In eclipse I imported then as Maven Projects. I try to build with maven and it fails unless I remove these lines from the pom.xml files.
<plugin>
<groupId>com.springsource.bundlor</groupId>
<artifactId>com.springsource.bundlor.maven</artifactId>
</plugin>
or else I get an error
[ERROR] Failed to execute goal com.springsource.bundlor:com.springsource.bundlor.maven:1.0.0.RELEASE:bundlor (bundlor-transform) on project spring-batch-admin-resources: Execution bundlor-transform of goal com.springsource.bundlor:com.springsource.bundlor.maven:1.0.0.RELEASE:bundlor failed: Plugin com.springsource.bundlor:com.springsource.bundlor.maven:1.0.0.RELEASE or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.objectweb.asm:com.springsource.org.objectweb.asm.tree:jar:3.1.0, org.objectweb.asm:com.springsource.org.objectweb.asm.commons:jar:3.1.0, org.objectweb.asm:com.springsource.org.objectweb.asm:jar:3.1.0: Could not find artifact org.objectweb.asm:com.springsource.org.objectweb.asm.tree:jar:3.1.0 in internal-repository (http://nexus-server:8082/nexus/content/groups/released) -> [Help 1]
You would have to add spring repositories in your pom.xml to tell maven to look there as well while looking up for dependencies as mentioned here

Maven deployment issues

I have a maven project that is built using the archetype-site.
I left the default directory structure as it is and added a directory for my files, so my current structure is this:
MyProject
-> src
-> pages
-> target
-> pom.xml
The pages directory is the one I added and it has a variety of HTML/CSS/JS files.
I've defined a remote repository on my pom.xml and have added the credentials to the relevant section in the settings.xml file of maven.
I'm getting the following error which I do not understand when I'm trying to deploy. Googling also did not help.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project MyProject: Failed to deploy artifacts: Could not find artifact MyProject:MyProject:jar:1.0-20121022.153807-1 in MyProject (https://bitbucket.org/MyApp/MyProject) -> [Help 1]

Maven deploy fails on Maven parent project

I have a maven project with the following hierarchy as created with NetBeans:
root/
Parent/
pom.xml
Project 1/
pom.xml
Project 2/
pom.xml
....
Project x/
pom.xml
When I try the release:perform it fails when attempting to deploy:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project (C:\checkout\pom.xml) has 1 error
[ERROR] Non-readable POM C:\checkout\pom.xml: C:\checkout\pom.xml (The system cannot find the file specified)
It looks like the plugin expects the pom to be on the root folder. I was unable to find a customization point on the plug-in to specify the pom.xml location.
Is this not possible, or did I organize the project wrong?
Searching on the net I found this post which pointed me to a question with the answer here.
It looks like you are trying to run mvn release:perform from your checkout root directory, while you should cd to Parent instead.
I assume that your project is indeed stored under Subversion or some other Maven-supported version control tool and that you checked it out in your C:\checkout directory.

Resources