I would like to run the mvn dependency:tree command on a lot of projects, but I sometimes get this error (example on google guava):
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Guava Maven Parent 31.1-jre:
[INFO]
[INFO] Guava Maven Parent ................................. SUCCESS [ 9.360 s]
[INFO] Guava: Google Core Libraries for Java .............. SUCCESS [ 1.473 s]
[INFO] Guava BOM .......................................... SUCCESS [ 4.277 s]
[INFO] Guava Testing Library .............................. SUCCESS [ 1.845 s]
[INFO] Guava Unit Tests ................................... SUCCESS [ 4.133 s]
[INFO] Guava GWT compatible libs .......................... FAILURE [ 8.632 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.051 s
[INFO] Finished at: 2022-03-15T15:22:05+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:tree (default-cli) on project guava-gwt: Execution default-cli of goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:tree failed: Plugin org.apache.maven.plugins:maven-dependency-plugin:3.1.1 or one of its dependencies could not be resolved: Could not find artifact com.google.guava:guava-tests:jar:test-sources:31.1-jre in sonatype-snapshots (https://oss.sonatype.org/content/repositories/snapshots/) -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :guava-gwt
If I run mvn install before this error does not appear. My problem is that sometimes the mvn install does not work.
Is there a way to make mvn dependency:tree work without using mvn install before?
Related
I have a maven project in Eclipse called TdkUtils, with this pom.xml:
This is a utils project. So I want to create a jar, put it in the repository and use it in another projects.
...
<groupId>com.tdk</groupId>
<artifactId>tdkUtils</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>tdkUtils</name>
...
But I got these errors when installing the plugin:
MacBook-Pro-de-nunito:tdkUtils nunito$ mvn install:install-file -Dfile=target/tdkUtils-0.0.1-SNAPSHOT.jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tdkUtils 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) # tdkUtils ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.353 s
[INFO] Finished at: 2017-09-18T11:29:58+02:00
[INFO] Final Memory: 9M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project tdkUtils: The artifact information is incomplete or not valid:
[ERROR] [0] 'groupId' is missing.
[ERROR] [1] 'artifactId' is missing.
[ERROR] [2] 'packaging' is missing.
[ERROR] [3] 'version' is missing.
[ERROR] -> [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/MojoExecutionException
If you just execute mvn install while inside the same directory with the util pom.xml file, maven will install the jar file into local repository for the user.
After that, the jar file can be used by the same user from other projects.
you can install a jar to local repo without pom.xml like this:
mvn install:install-file -Dfile=target/tdkUtils-0.0.1-SNAPSHOT.jar -DgroupId=com.tdk -DartifactId=tdkUtils -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar
Getting Error At the time of running the
mvn appengine:endpoints_get_client_lib
I got their are some issue with the maven plugin but how can i solve them.
error Log is given below.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building claritus-travelaware 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- appengine-maven-plugin:1.9.42:endpoints_get_client_lib (default-cli) # claritus-travelaware ---
[INFO]
[INFO] Google App Engine Java SDK - Generate endpoints get client lib
[INFO] Using Class Name:com.claritus.travelaware.endpoint.UserLocationEP
[INFO] Using Class Name:com.claritus.travelaware.endpoint.SubscribeUserEP
[INFO] Using Class Name:com.claritus.travelaware.YourFirstAPI
[INFO] Executing endpoints Command=[get-client-lib, -cp, /home/claritus/Desktop/workspace/claritus-travelaware/target/claritus-travelaware-1.0-SNAPSHOT/WEB-INF/classes:/home/claritus/Desktop/workspace/claritus-travelaware/target/classes:/home/claritus/.m2/repository/com/google/appengine/appengine-api-1.0-sdk/1.9.42/appengine-api-1.0-sdk-1.9.42.jar:/home/claritus/.m2/repository/com/google/appengine/appengine-endpoints/1.9.42/appengine-endpoints-1.9.42.jar:/home/claritus/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/home/claritus/.m2/repository/mysql/mysql-connector-java/5.1.31/mysql-connector-java-5.1.31.jar:/home/claritus/.m2/repository/org/hibernate/hibernate-core/4.2.0.Final/hibernate-core-4.2.0.Final.jar:/home/claritus/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/home/claritus/.m2/repository/org/jboss/logging/jboss-logging/3.1.0.GA/jboss-logging-3.1.0.GA.jar:/home/claritus/.m2/repository/org/jboss/spec/javax/transaction/jboss-transaction-api_1.1_spec/1.0.0.Final/jboss-transaction-api_1.1_spec-1.0.0.Final.jar:/home/claritus/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/home/claritus/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.1.Final/hibernate-jpa-2.0-api-1.0.1.Final.jar:/home/claritus/.m2/repository/org/javassist/javassist/3.15.0-GA/javassist-3.15.0-GA.jar:/home/claritus/.m2/repository/org/hibernate/common/hibernate-commons-annotations/4.0.1.Final/hibernate-commons-annotations-4.0.1.Final.jar:/home/claritus/.m2/repository/org/springframework/security/spring-security-core/4.0.4.RELEASE/spring-security-core-4.0.4.RELEASE.jar:/home/claritus/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/home/claritus/.m2/repository/org/springframework/spring-beans/4.2.5.RELEASE/spring-beans-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/org/springframework/spring-context/4.2.5.RELEASE/spring-context-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/org/springframework/spring-expression/4.2.5.RELEASE/spring-expression-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/org/springframework/spring-core/4.2.5.RELEASE/spring-core-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/home/claritus/.m2/repository/org/springframework/spring-aop/4.2.5.RELEASE/spring-aop-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/org/springframework/spring-webmvc/4.2.5.RELEASE/spring-webmvc-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/org/springframework/spring-web/4.2.5.RELEASE/spring-web-4.2.5.RELEASE.jar, -o, /home/claritus/Desktop/workspace/claritus-travelaware/target/generated-sources/appengine-endpoints/WEB-INF, -w, /home/claritus/Desktop/workspace/claritus-travelaware/target/generated-sources/appengine-endpoints, -l, java, -bs, maven, com.claritus.travelaware.endpoint.UserLocationEP, com.claritus.travelaware.endpoint.SubscribeUserEP, com.claritus.travelaware.YourFirstAPI]
API client library written to /home/claritus/Desktop/workspace/claritus-travelaware/target/generated-sources/appengine-endpoints/WEB-INF/userLocation-v1-java.zip
API client library written to /home/claritus/Desktop/workspace/claritus-travelaware/target/generated-sources/appengine-endpoints/WEB-INF/subscribeUsers-v1-java.zip
API client library written to /home/claritus/Desktop/workspace/claritus-travelaware/target/generated-sources/appengine-endpoints/WEB-INF/firstApi-v1-java.zip
[INFO] BUILDING Endpoints Client Library from: /home/claritus/Desktop/workspace/claritus-travelaware/target/endpoints-client-libs/firstApi/pom.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.227 s
[INFO] Finished at: 2016-09-16T10:07:40+05:30
[INFO] Final Memory: 19M/170M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.42:endpoints_get_client_lib (default-cli) on project claritus-travelaware: Execution default-cli of goal com.google.appengine:appengine-maven-plugin:1.9.42:endpoints_get_client_lib failed: ${maven.home} is not specified as a directory: '/home/claritus/Desktop/workspace/claritus-travelaware/EMBEDDED'. -> [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/PluginExecutionException
I'm working on Leshan (https://github.com/eclipse/leshan).
I've run the Leshan project in command line, so I use this command to launch tests:
mvn test
and I have errors:
Results :
Failed tests:
BootstrapTest.bootstrap:59 expected:<1> but was:<0>
SecurityTest.register_update_reregister_device_with_psk_to_server_with_psk:130 Values should be different. Actual: qtjLtAHNqi
Tests in error:
ObserveTest.can_observe_object:137 NullPointer
WriteTest.can_write_string_resource_in_tlv:74->write_string_resource:90 NullPointer
Tests run: 100, Failures: 2, Errors: 2, Skipped: 13
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] leshan ............................................. SUCCESS [0.092 s]
[INFO] leshan - core ...................................... SUCCESS [9.903 s]
[INFO] leshan - server core ............................... SUCCESS [1.666 s]
[INFO] leshan - server californium ........................ SUCCESS [2.778 s]
[INFO] leshan - client core ............................... SUCCESS [1.663 s]
[INFO] leshan - client californium ........................ SUCCESS [0.260 s]
[INFO] leshan - integration tests .........................FAILURE [33.324 s]
[INFO] leshan - server demo ............................... SKIPPED
[INFO] leshan - client demo ............................... SKIPPED
[INFO] leshan - bootstrap server demo ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.197 s
[INFO] Finished at: 2016-06-07T13:50:17+02:00
[INFO] Final Memory: 29M/288M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project leshan-integration-tests: There are test failures.
[ERROR]
[ERROR] Please refer to C:\dvp_win\leshan-master\leshan-integration-tests\target\surefire-reports for the individual test results.
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :leshan-integration-tests
Please can you help me to solve this problem?
Not a great question. But your answer is there in the Maven output.
Failed tests:
BootstrapTest.bootstrap:59 expected:<1> but was:<0>
SecurityTest.register_update_reregister_device_with_psk_to_server_with_psk:130 Values should be different. Actual: qtjLtAHNqi
Tests in error:
ObserveTest.can_observe_object:137 NullPointer
WriteTest.can_write_string_resource_in_tlv:74->write_string_resource:90 NullPointer
Look at the BootstrapTest and SecurityTest .
If you want to run project without fail, you better skip the test.
command - mvn clean install -DskipTests
Refer to github https://github.com/eclipse/leshan/issues/323
Im building a custom maven project for jenkins. After using the command
mvn -Plight-test install
I recieve this error .Please help. I have also added the plugin for surefire exception in the pom.xml file, but it isn't working! The error log is as follows :
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Jenkins main module ................................ SUCCESS [ 11.809 s]
[INFO] Jenkins cli ........................................ SUCCESS [ 38.319 s]
[INFO] Jenkins core ....................................... FAILURE [11:15 min]
[INFO] Jenkins war ........................................ SKIPPED
[INFO] Tests for Jenkins core ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:10 min
[INFO] Finished at: 2016-05-05T12:26:54+05:30
[INFO] Final Memory: 39M/277M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project jenkins-core:
.
[ERROR]
[ERROR] Please refer to C:\Users\Anishas\git\jenkins\core\target\surefire-reports for the individual test results.
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :jenkins-core
Compile :
I had the same issues and I found out that the problem was that some of tests tried to create a System link and it was not possible because I didn't start my IDE (IntellijIdea) as administrator in Windows.
I started Intellij as administrator and that solved the problem.
Skipping test is not a good practice when developing.
mvn -Dmaven.test.skip=true -DskipTests=true clean install
use this command
Rerun with mvn -Plight-test install -rf jenkins-core -X to isolate the error
I am on Ubuntu 14.04 LTS, Java 7, have installed Rasperry Pi, have also setup the kura eclipse workspace. Now I want to use the Kura source code to start the sample application.
I followed the Eclipse Kura getting started guide here
but when i ran `mvn clean install` in the kura/target-platform directory,
it failed with the following message:
[INFO] Reactor Summary:
[INFO]
[INFO] target-platform .................................... SUCCESS [ 0.147 s]
[INFO] Java API for working with Human Interface USB Devices (HID) SUCCESS [ 1.832 s]
[INFO] javax.usb API from javax-usb ....................... SUCCESS [ 0.226 s]
[INFO] javax.usb Common from javax-usb .................... SUCCESS [ 0.239 s]
[INFO] javax.usb Linux implementation from javax-usb ...... SUCCESS [ 0.190 s]
[INFO] Serial Device based on SODA DK comm ................ SUCCESS [ 0.483 s]
[INFO] p2-repo-common ..................................... FAILURE [ 0.491 s]
[INFO] p2-repo-equinox_3.8.1 .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.008 s
[INFO] Finished at: 2015-05-14T18:05:23+08:00
[INFO] Final Memory: 31M/427M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.9:copy (copy-dio-bundle-for-publishing) on project p2-repo-common: Unable to find artifact. Could not find artifact jdk:jdk.dio:jar:1.0.1 in nexus-releases (http://192.168.0.119:8081/nexus/content/groups/public)
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=jdk -DartifactId=jdk.dio -Dversion=1.0.1 -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=jdk -DartifactId=jdk.dio -Dversion=1.0.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR]
[ERROR] jdk:jdk.dio:jar:1.0.1
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] nexus-releases (http://192.168.0.119:8081/nexus/content/groups/public, releases=true, snapshots=true)
[ERROR] -> [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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :p2-repo-common
It is complaining not finding artifact jdk:jdk.dio:jar:1.0.1 which is provided in Java ME as far as I know. Do I need to install anything first before building the Kura source code?
The jdk.dio artifact is available in the "Add-ons" repo provided by Eurotech at https://raw.github.com/eurotech/kura_addons/mvn-repo
It looks like you may have a custom Maven settings file that causes everything to be searched in your local Nexus? (http://192.168.0.119:8081)
HTH.