0

我正在尝试通过 SSH 在服务器上执行此命令:

mvn tomcat:run-war &

但是该插件不在本地仓库中:

[INFO] Scanning for projects...

[INFO] 搜索带有前缀的插件的存储库:'tomcat'。[INFO] org.apache.maven.plugins:检查来自中央的更新

所以我尝试:

$ mvn dependency:get -DrepoUrl=http://download.java.net/maven/2/ -Dartifact=org.codehaus.mojo:tomcat-maven-plugin

但即使org.apache.maven.plugins:maven-dependency-plugin不存在。那么,安装 maven-dependency-plugin 最“命令行友好”的方式是什么,所以要安装 tomcat 呢?

$ mvn --version
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.6.0_22
Java home: /usr/lib/jvm/java-6-sun-1.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"
4

1 回答 1

0

将 jar 和 pom 上传到服务器:

$ 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

安装:

$ 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
于 2011-05-23T06:32:54.910 回答