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
Related
I was using the followig command to build the project
mvn compile exec:java clean install
and it was working. I wished it to install sources to local repository and wrote
mvn compile exec:java source:jar clean install
and now it fails with
...
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing MYSOURCEPATH\target\my-library-1.12.1.jar with MYSOURCEPATH\target\my-library-1.12.1-shaded.jar
[INFO] Dependency-reduced POM written at: MYSOURCEPATH\dependency-reduced-pom.xml
[INFO] Dependency-reduced POM written at: MYSOURCEPATH\dependency-reduced-pom.xml
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # my-library ---
[INFO] Installing MYSOURCEPATH\target\my-library-1.12.1.jar to MYLOCALREPOPATH\MYLIBRARYPATH\1.12.1\my-library-1.12.1.jar
[INFO] Installing MYSOURCEPATH\dependency-reduced-pom.xml to MYLOCALREPOPATH\MYLIBRARYPATH\1.12.1\my-library-1.12.1.pom
[INFO] Installing MYSOURCEPATH\target\my-library-1.12.1-sources.jar to MYLOCALREPOPATH\MYLIBRARYPATH\1.12.1\my-library-1.12.1-sources.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.280 s
[INFO] Finished at: 2018-02-26T18:38:23+03:00
[INFO] Final Memory: 46M/1373M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default-install) on project my-library: Failed to install artifact my.library.fqn:my-library:jar:sources:1.12.1: MYSOURCEPATH\target\my-library-1.12.1-sources.jar (The system cannot find the file specified) -> [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
how to fix/overcome?
Try
mvn clean source:jar compile install exec:java
Or just:
mvn clean source:jar install exec:java
So basically you need to put the "clean" before the "source:jar"
or else installation for sources will fail
I am trying download a jersey-quickstart-webapp using maven. I am unable to figure out what is wrong with my command below.
mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.2
The errors I get are below: what am I doing wrong here?
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] >>> maven-archetype-plugin:3.0.0:generate (default-cli) > generate-sources # standalone-pom
[INFO] Generating project in Interactive mode
[WARNING] No archetype found in remote catalog. Defaulting to internal catalog
[WARNING] Archetype not found in any catalog. Falling back to central repository
(http://repo.maven.apache.org/maven2).
[WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
Downloading: http://repo.maven.apache.org/maven2/org/glassfish/jersey/archetypes/jersey-quickstart-webapp/2.2/jersey-quickstart-webapp-2.2.pom
Downloading: https://repo.maven.apache.org/maven2/org/glassfish/jersey/archetypes/jersey-quickstart-webapp/2.2/jersey-quickstart-webapp-2.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.330 s
[INFO] Finished at: 2017-03-29T20:46:00+05:30
[INFO] Final Memory: 14M/139M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.0:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.glassfish.jersey.archetypes:jersey-quickstart-webapp:2.2) -> [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.
The version you have specified is wrong(NOT 2.2 its 2.25.1). Try to run this:
mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.25.1
The issue was not with the command but the settings.xml.
I had to add my local artifactory setton
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.
I need to run mvn verify in a secured box where maven is not able to download anything. I am able to run the command on my local laptop, so I copied my local .m2 folder to the secured box. However, I got this error:
$ mvn verify -o
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building <Masked strings>
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.109s
[INFO] Finished at: Wed May 07 20:49:26 UTC 2014
[INFO] Final Memory: 10M/232M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: The repository system is offline but the artifact org.apache.maven.plugins:maven-plugins:pom:19 is not available in the local repository. -> [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
So, looks like copying .m2 is not enough. So, what should I do to make sure maven can do the job without downloading anything?
Thank you very much.