Maven Could not find artifact after downloading from Nexus - java

we have got a problem. I set up job on jenkins and while building a project it fetches artifacts from nexus. But even though it downloaded them job failed with artifacts could not be found. It happened only to artifacts we manually imported to the nexus.
Any hints?
[INFO] Downloading: http://xxx/nexus/content/groups/public/com/oracle/aqapi /12.1.0.2/aqapi-12.1.0.2.pom
[WARNING] The POM for com.oracle:aqapi:jar:12.1.0.2 is missing, no dependency information available
[INFO] Downloading: http://xxx/nexus/content/groups/public/com/ibm/com.ibm.mq/7.1/com.ibm.mq-7.1.pom
[WARNING] The POM for com.ibm:com.ibm.mq:jar:7.1 is missing, no dependency information available
[INFO] Downloading: http://xxx/nexus/content/groups/public/com/ibm/com.ibm.dhbcore/7.1/com.ibm.dhbcore-7.1.pom
[WARNING] The POM for com.ibm:com.ibm.dhbcore:jar:7.1 is missing, no dependency information available
[INFO] Downloading: http://xxx/nexus/content/groups/public/com/oracle/aqapi/12.1.0.2/aqapi-12.1.0.2.jar
[INFO] Downloading: http://xxx/nexus/content/groups/public/com/ibm/com.ibm.mq/7.1/com.ibm.mq-7.1.jar
[INFO] Downloading: http://xxx/nexus/content/groups/public/com/ibm/com.ibm.dhbcore/7.1/com.ibm.dhbcore-7.1.jar
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
....
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.091s
[INFO] Finished at: Fri Dec 22 14:09:58 CET 2017
[INFO] Final Memory: 16M/491M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project XXX: Could not resolve dependencies for project YYY:jar:2.14.11: The following artifacts could not be resolved: com.oracle:aqapi:jar:12.1.0.2, com.ibm:com.ibm.mq:jar:7.1, com.ibm:com.ibm.dhbcore:jar:7.1: Could not find artifact com.oracle:aqapi:jar:12.1.0.2 in nexus (http://xxx/nexus/content/groups/public) -> [Help 1]
[ERROR]`

I think it has not downloaded completely yet, you can check in ~/.m2/repository for dependency.
Because its showing only "downloading" in actual case it will appear downloaded message.
first check for the n/w settings and internet.
if n/w is not the issue delete the ~/.m2 folder and retry once again

Do you see the dependency in Nexus?
Does Information in pom file in nexus correspond to your pom?
http://nexusUrl/nexus/content/repositories/central/checkstyle/checkstyle/4.1/checkstyle-4.1.pom
<?xml version="1.0"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>checkstyle</groupId>
<artifactId>checkstyle</artifactId>
<version>4.1</version>
<dependencies>
...
</dependencies>
</project>
and in your pom:
<dependency>
<groupId>checkstyle</groupId>
<artifactId>checkstyle</artifactId>
<version>4.1</version>
</dependency>
and check your settings for access to Nexus (settings.xml).

Related

Failed to execute goal on project spark-core_2.11

,
Spark code compile operation fails on few machines whereas the same source code passes on few other machines.
Please check the error on Centos (4.10.12-1.el7.elrepo.x86_64)
./build/mvn -X -DskipTests -Dscala.lib.directory=/usr/share/scala -pl core compile
INFO] Building Spark Project Core 2.2.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.spark:spark-launcher_2.11:jar:2.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.spark:spark-network-common_2.11:jar:2.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.spark:spark-network-shuffle_2.11:jar:2.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.spark:spark-unsafe_2.11:jar:2.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.spark:spark-tags_2.11:jar:2.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.spark:spark-tags_2.11:jar:tests:2.2.2-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.804 s
[INFO] Finished at: 2017-12-04T23:18:58-08:00
[INFO] Final Memory: 43M/1963M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project spark-core_2.11: Could not resolve dependencies for project org.apache.spark:spark-core_2.11:jar:2.2.2-SNAPSHOT: The following artifacts could not be resolved: org.apache.spark:spark-launcher_2.11:jar:2.2.2-SNAPSHOT, org.apache.spark:spark-network-common_2.11:jar:2.2.2-SNAPSHOT, org.apache.spark:spark-network-shuffle_2.11:jar:2.2.2-SNAPSHOT, org.apache.spark:spark-unsafe_2.11:jar:2.2.2-SNAPSHOT, org.apache.spark:spark-tags_2.11:jar:2.2.2-SNAPSHOT, org.apache.spark:spark-tags_2.11:jar:tests:2.2.2-SNAPSHOT: Failure to find org.apache.spark:spark-launcher_2.11:jar:2.2.2-SNAPSHOT in http://artifact.eng.stellus.in:8081/artifactory/libs-snapshot was cached in the local repository, resolution will not be reattempted until the update interval of snapshots has elapsed or updates are forced -> [Help 1]
Note: The same source code passes on another CentOS machine(3.10.0-514.el7.x86_64)
./build/mvn -DskipTests -Dscala.lib.directory=/usr/share/scala -pl core compile
[INFO] — maven-compiler-plugin:3.7.0:compile (default-compile) # spark-core_2.11 —
[INFO] Not compiling main sources
[INFO]
[INFO] — scala-maven-plugin:3.2.2:compile (scala-compile-first) # spark-core_2.11 —
[INFO] Using zinc server for incremental compilation
[info] Compile success at Dec 4, 2017 11:17:34 PM [0.331s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.663 s
[INFO] Finished at: 2017-12-04T23:17:34-08:00
[INFO] Final Memory: 52M/1297M
[INFO] ------------------------------------------------------------------------
If the build works only in specific machine it means that you already have the missing dependency on your .m2 local repository.
If you will remove all your directories under .m2 (on the centos machine) the build will fail.
You should add all your missing dependencies.
[WARNING] The POM for org.apache.spark:spark-launcher_2.11:jar:2.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.spark:spark-network-common_2.11:jar:2.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.spark:spark-network-shuffle_2.11:jar:2.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.spark:spark-unsafe_2.11:jar:2.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.spark:spark-tags_2.11:jar:2.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.spark:spark-tags_2.11:jar:tests:2.2.2-SNAPSHOT is missing, no dependency information available
The following patch fix the compilation bug
diff --git a/pom.xml b/pom.xml
index cc48ee794e..ef0b01bec8 100644
--- a/pom.xml
+++ b/pom.xml
## -2518,6 +2518,13 ##
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
See here stackoverflow.com/questions/4786881
why is "test-jar" dependency required for "mvn compile"
Another possibility:
you have a maven profile that does <maven.test.skip>true</maven.test.skip> (which skips both test compilation and execution)
instead of
<skipTests>true</skipTests>
(which skip execution, but compiles test)

Weblogic Maven Deploy with Luna eclipse

I am using weblogic 12.1.1.0 . I want to deploy my project to weblogic server with maven plugin.
But when I build my project, I get this error
[INFO] Scanning for projects...
[WARNING] The POM for com.oracle.weblogic:wls-maven-plugin:jar:12.1.1.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for com.oracle.weblogic:wls-maven-plugin:12.1.1.0: Plugin com.oracle.weblogic:wls-maven-plugin:12.1.1.0 or one of its dependencies could not be resolved: Failure to find com.oracle.weblogic:wls-maven-plugin:jar:12.1.1.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test1 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.oracle.weblogic:wls-maven-plugin:jar:12.1.1.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for com.oracle.weblogic:wls-maven-plugin:12.1.1.0: Plugin com.oracle.weblogic:wls-maven-plugin:12.1.1.0 or one of its dependencies could not be resolved: Failure to find com.oracle.weblogic:wls-maven-plugin:jar:12.1.1.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO]
[INFO] --- weblogic-maven-plugin:2.9.5:deploy (default-cli) # test1 ---
[WARNING] The POM for weblogic:weblogic:jar:10.3.6 is missing, no dependency information available
[WARNING] The POM for weblogic:webservices:jar:10.3.6 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.533 s
[INFO] Finished at: 2015-01-27T08:38:04+03:30
[INFO] Final Memory: 7M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:weblogic-maven-plugin:2.9.5:deploy (default-cli) on project test1: Execution default-cli of goal org.codehaus.mojo:weblogic-maven-plugin:2.9.5:deploy failed: Plugin org.codehaus.mojo:weblogic-maven-plugin:2.9.5 or one of its dependencies could not be resolved: The following artifacts could not be resolved: weblogic:weblogic:jar:10.3.6, weblogic:webservices:jar:10.3.6: Failure to find weblogic:weblogic:jar:10.3.6 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
and this is my pom.xml
<properties>
<weblogic.adminurl>t3://localhost:7001</weblogic.adminurl>
<weblogic.user>weblogic</weblogic.user>
<weblogic.password>12345678</weblogic.password>
<weblogic.remote>false</weblogic.remote>
</properties>
<build>
<plugins>
<!-- WebLogic Server 12c Maven Plugin -->
<plugin>
<groupId>com.oracle.weblogic</groupId>
<artifactId>wls-maven-plugin</artifactId>
<version>12.1.1.0</version>
<configuration>
<adminurl>${weblogic.adminurl}</adminurl>
<user>${weblogic.user}</user>
<password>${weblogic.password}</password>
<source>../test1/target/test1-0.0.1-SNAPSHOT.war</source>
<name>test1</name>
</configuration>
</plugin>
</plugins>
</build>
i added two jar file in project wlfullclient.jar and webservices.jar
Have you run the setup procedures for Oracle's weblogic plugin? The plugin has dependencies that are not in public repositories, they are part of the wls12 installation and must be installed into Maven
http://docs.oracle.com/middleware/1212/wls/WLPRG/maven.htm#CHEIHIEH

creating new project in java with maven

I wanna create a java project with maven, when I type this command in cmd instead of creating a project it gives some error, I guess it is because of some internet problems but I don't know how to solve it. I don't use any proxy and I've tried this command even when my pc's firewall was turned off.
the command I write in cmd is:
mvn archetype:generate -DgroupId=com.companyname.bank -DartifactId=consumerBanking -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
the rezult is:
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
.
.
.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.167 s
[INFO] Finished at: 2012-05-18T21:09:38-07:00
[INFO] Final Memory: 3M/254M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\a\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
You're posting this in 2014, but the log says:
[INFO] Finished at: 2012-05-18T21:09:38-07:00
If your local clock is wrong, SSL won't work because the certificate will appear to be invalid, and your connection to https://repo.maven.apache.org/ will fail.
Fix your clock.

Magnolia project archetype can not resolve vaadin dependencies

I'm trying to create a Magnolia project archetype:
I'm running
mvn archetype:generate -DarchetypeCatalog=http://nexus.magnolia-cms.com/content/groups/public/
I choose
5: http://nexus.magnolia-cms.com/content/groups/public/ -> info.magnolia.maven.archetypes:magnolia-project-archetype (An archetype to create a Magnolia project (a parent pom and a webapp))
archetype version I choose 1.1.0
Define value for property 'magnolia-version': 5.0.4
When I run the maven build, the webapp build fails because it cant find some vaadin libraries
[WARNING] The POM for org.vaadin.addons:icepush:jar:0.5.3 is missing, no dependency information available
[WARNING] The POM for org.vaadin.addons:cssinject:jar:2.0.3 is missing, no dependency information available
[WARNING] The POM for org.vaadin.addons:gwt-graphics:jar:1.0.0 is missing, no dependency information available
[WARNING] The POM for org.vaadin.addons:ckeditor-wrapper-for-vaadin:jar:7.8.3 is missing, no dependency information available
[WARNING] The POM for org.vaadin.addon:easyuploads:jar:7.0.0 is missing, no dependency information available
[WARNING] The POM for org.vaadin.addons:refresher:jar:1.2.1.7 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] myapp (parent pom) ............................. SUCCESS [0.394s]
[INFO] myapp: webapp .................................. FAILURE [1.305s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.962s
[INFO] Finished at: Wed Sep 18 13:53:45 CEST 2013
[INFO] Final Memory: 7M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project myapp-webapp: Could not resolve dependencies for project myapp-webapp:war:1.0-SNAPSHOT: The following artifacts could not be resolved: org.vaadin.addon:easyuploads:jar:7.0.0, org.vaadin.addons:refresher:jar:1.2.1.7, org.vaadin.addons:cssinject:jar:2.0.3, org.vaadin.addons:icepush:jar:0.5.3, org.vaadin.addons:gwt-graphics:jar:1.0.0, org.vaadin.addons:ckeditor-wrapper-for-vaadin:jar:7.8.3: Failure to find org.vaadin.addon:easyuploads:jar:7.0.0 in http://nexus.magnolia-cms.com/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of magnolia.public has elapsed or updates are forced -> [Help 1]
[ERROR]
Do I need to add some maven repository ?
Solved it by adding following repository in my pom.xml
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>

Missing artifact in attempted build using Maven

I'm trying to build a project in Eclipse with Maven. However I get the error
Missing artifact net.sf.doodleproject:numerics4j:jar:1.3
Running
mvn install
I got
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - tahrirproject:tahrir:jar:0.0.1-SNAPSHOT
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
Downloading: http://repo2.maven.org/maven2/net/sf/doodleproject/numerics4j/1.3/numerics4j-1.3.pom
[INFO] Unable to find resource 'net.sf.doodleproject:numerics4j:pom:1.3' in repository repo2_maven_org (http://repo2.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/net/sf/doodleproject/numerics4j/1.3/numerics4j-1.3.pom
[INFO] Unable to find resource 'net.sf.doodleproject:numerics4j:pom:1.3' in repository central (http://repo1.maven.org/maven2)
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
Downloading: http://repo2.maven.org/maven2/net/sf/doodleproject/numerics4j/1.3/numerics4j-1.3.jar
[INFO] Unable to find resource 'net.sf.doodleproject:numerics4j:jar:1.3' in repository repo2_maven_org (http://repo2.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/net/sf/doodleproject/numerics4j/1.3/numerics4j-1.3.jar
[INFO] Unable to find resource 'net.sf.doodleproject:numerics4j:jar:1.3' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) net.sf.doodleproject:numerics4j:jar:1.3
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=net.sf.doodleproject -DartifactId=numerics4j -Dversion=1.3 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=net.sf.doodleproject -DartifactId=numerics4j -Dversion=1.3 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) tahrirproject:tahrir:jar:0.0.1-SNAPSHOT
2) net.sf.doodleproject:numerics4j:jar:1.3
----------
1 required artifact is missing.
for artifact:
tahrirproject:tahrir:jar:0.0.1-SNAPSHOT
from the specified remote repositories:
repo2_maven_org (http://repo2.maven.org/maven2),
central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Mon Mar 26 21:17:33 IST 2012
[INFO] Final Memory: 12M/105M
[INFO] ------------------------------------------------------------------------
So it seems like it's trying to download from a central repository even though it's specified in the pom.xml file.
pom.xml is here
Change pom section to:
<repositories>
<repository>
<id>doodleproject-repo</id>
<name>DoodleProject Maven 2 Repository</name>
<url>http://doodleproject.sourceforge.net/maven2/release</url>
</repository>
<repository>
<id>repo2_maven_org</id>
<url>http://repo2.maven.org/maven2</url>
</repository>
</repositories>

Categories

Resources