Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
915 views
in Technique[技术] by (71.8m points)

installation - 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?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...