How do I get maven-dependency-plugin from the command line?
I'm trying to execute this command on a server through SSH:
mvn tomcat:run-war &
But that plugin is not in the local repo:
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'tomcat'. [INFO] org.apache.maven.plugins: checking for updates from central
So I try:
$ mvn dependency:get -DrepoUrl=http://download.java.net/maven/2/ -Dartifact=org.codehaus.mojo:tomcat-maven-plugin
But even org.apache.maven.plugins:maven-dependency-plugin
is not there. So, what's the most 'command-line friendly' way of installing maven-dependency-plugin, so to install the tomcat one?
$ mvn --version
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.6.0_22
Java home: /usr/lib/jvm/java-6-sun-1.开发者_StackOverflow中文版6.0.22/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-29-server" arch: "amd64" Family: "unix"
Upload the jar and pom to server:
$ scp ~/.m2/repository/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.jar gkahlout@192.168.344.511:/home/gkahlout
maven-dependency-plugin-2.1.jar
$ scp ~/.m2/repository/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom gkahlout@192.168.344.511:/home/gkahlout
Install:
$ mvn install:install-file -DgroupId=org.apache.maven.plugins -DartifactId=maven-dependency-plugin -Dversion=1.1 -Dfile=maven-dependency-plugin-2.1.jar -Dpackaging=jar
$ mvn dependency:get -DrepoUrl=http://download.java.net/maven/2/ -Dartifact=org.codehaus.mojo:tomcat-maven-plugin:1.1
精彩评论