简体   繁体   中英

How to use third party maven dependency on commandline?

I have a private maven dependency (jar) in our Artifactory in the repository third party. Now I want to use this jar like this:

mvn org.company:xxx-maven-plugin:0.0.4 -Dmaven.repo.remote=https://artifactory:443/third-party

But this fails with: Could not find goal '0.0.4'

How can I define in a maven command (not in the pom or something) to use a third party maven dependency from our artifactory?

First of all, you usually specify repositories in your settings.xml . The maven.repo.remote seems to be Maven 1.x syntax and I do not know whether it still works.

Secondly (and more importantly), you cannot just call a plugin, but you call a goal within that plugin. The syntax is:

groupId:artifactId:version:goal

Your line is missing the goal. You need to look up its name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM