Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manually install an artifact in Maven 2?

I've encountered some errors when I tried to install an artifact manually with Maven 2. I wanted to install a jar from a local directory with the command

mvn install:install-file -Dfile=jta-1.0.1B.jar 

But Maven gave a build error which reads like:

Invalid task '.01B.jar': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal 

Is there a mistake with my command?

like image 678
liangzan Avatar asked Jan 14 '09 07:01

liangzan


People also ask

How do you install artifacts?

From within your project, select Artifacts, and then select your feed. Select Connect to feed. Select Maven. If this is the first time using Azure Artifacts with Maven, select Get the tools button and follow the instructions to download and install the prerequisites.


1 Answers

You need to indicate the groupId, the artifactId and the version for your artifact:

mvn install:install-file \   -DgroupId=javax.transaction \   -DartifactId=jta \   -Dpackaging=jar \   -Dversion=1.0.1B \   -Dfile=jta-1.0.1B.jar \   -DgeneratePom=true 
like image 147
Romain Linsolas Avatar answered Sep 27 '22 23:09

Romain Linsolas