安装Maven插件作为依赖?

时间:2014-06-09 06:22:02

标签: maven plugins dependencies

我正在尝试将特定插件(maven-dependency-plugin)下载到特定的本地存储库。

我可以将该插件添加为依赖项,就像我将其他任何工件运行mvn install一样吗?

我问的原因是我一直在尝试上述内容,无论何时涉及到该插件的依赖关系,它都无法从maven中心获取它们,而且它基本上无法正常工作:(

我的pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.stuff</groupId>
    <artifactId>thestuff</artifactId>
    <version>0.0.1</version>
    <packaging>war</packaging>

    <dependencies>
        <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.1</version>
    </dependency>
    </dependencies>

</project>

错误(嗯,前几个):

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2:single (make-zip-assembly) on project stuff: Failed to create assembly: Unable to resolve dependencies for assembly 'zip': Failed to resolve dependencies for assembly: Missing:
[ERROR] ----------
[ERROR] 1) org.apache.maven:maven-plugin-api:jar:2.0.9
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven -DartifactId=maven-plugin-api -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven -DartifactId=maven-plugin-api -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-plugin-api:jar:2.0.9
[ERROR] 
[ERROR] 2) org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-container-default -Dversion=1.0-alpha-9-stable-1 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-container-default -Dversion=1.0-alpha-9-stable-1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[ERROR] 
[ERROR] 3) org.apache.maven:maven-profile:jar:2.0.9
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven -DartifactId=maven-profile -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven -DartifactId=maven-profile -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-project:jar:2.0.9
[ERROR] 4) org.apache.maven:maven-profile:jar:2.0.9
[ERROR] 
[ERROR] 4) org.apache.maven:maven-artifact-manager:jar:2.0.9
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven -DartifactId=maven-artifact-manager -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven -DartifactId=maven-artifact-manager -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-project:jar:2.0.9
[ERROR] 4) org.apache.maven:maven-artifact-manager:jar:2.0.9
[ERROR] 
[ERROR] 5) org.apache.maven:maven-repository-metadata:jar:2.0.9
[JENKINS] Archiving /root/.jenkins/jobs/yes - NIGHTLY/workspace/com/tsx/yes/core/brms_adapter/pom.xml to stuff.pom
[JENKINS] Archiving /opt/tsx/ESB_container/deploy/stuff.kar to stuff.kar
/opt/tsx/ESB_container/deploy/stuff.kar is not inside /root/.jenkins/jobs/yes - NIGHTLY/workspace/stuff/; will archive in a separate pass
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven -DartifactId=maven-repository-metadata -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven -DartifactId=maven-repository-metadata -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-core:jar:2.0.9
[ERROR] 4) org.apache.maven:maven-repository-metadata:jar:2.0.9
[ERROR] 
[ERROR] 6) org.apache.maven:maven-plugin-registry:jar:2.0.9
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven -DartifactId=maven-plugin-registry -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven -DartifactId=maven-plugin-registry -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-project:jar:2.0.9
[ERROR] 4) org.apache.maven:maven-plugin-registry:jar:2.0.9
[ERROR] 
[ERROR] 7) org.apache.maven:maven-core:jar:2.0.9
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven -DartifactId=maven-core -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven -DartifactId=maven-core -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....p:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-core:jar:2.0.9
[ERROR] 
[ERROR] 8) org.apache.maven.wagon:wagon-file:jar:1.0-beta-2
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-file -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-file -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-core:jar:2.0.9
[ERROR] 4) org.apache.maven.wagon:wagon-file:jar:1.0-beta-2
[ERROR] 
[ERROR] 9) org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven -DartifactId=maven-plugin-parameter-documenter -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven -DartifactId=maven-plugin-parameter-documenter -Dversion=2.0.9 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-core:jar:2.0.9
[ERROR] 4) org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9
[ERROR] 
[ERROR] 10) org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-webdav -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-webdav -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....p:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-core:jar:2.0.9
[ERROR] 4) org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2
[ERROR] 
[ERROR] 11) slide:slide-webdavlib:jar:2.1
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=slide -DartifactId=slide-webdavlib -Dversion=2.1 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=slide -DartifactId=slide-webdavlib -Dversion=2.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-core:jar:2.0.9
[ERROR] 4) org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2
[ERROR] 5) slide:slide-webdavlib:jar:2.1
[ERROR] 
[ERROR] 12) de.zeigermann.xml:xml-im-exporter:jar:1.1
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=de.zeigermann.xml -DartifactId=xml-im-exporter -Dversion=1.1 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=de.zeigermann.xml -DartifactId=xml-im-exporter -Dversion=1.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-core:jar:2.0.9
[ERROR] 4) org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2
[ERROR] 5) slide:slide-webdavlib:jar:2.1
[ERROR] 6) de.zeigermann.xml:xml-im-exporter:jar:1.1
[ERROR] 
[ERROR] 13) org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-2
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-http-lightweight -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[JENKINS] Archiving /root/.jenkins/jobs/yes - NIGHTLY/workspace/stuff/pom.xml to stuff.pom
[JENKINS] Archiving /root/.jenkins/jobs/yes - NIGHTLY/workspace/yes/target/stuff.jar to stuff/UDMS/0.0.1-20140606.120021-863/UDMS-0.0.1-20140606.120021-863.jar
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-http-lightweight -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) stuff....:pom:1.0.1
[ERROR] 2) org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[ERROR] 3) org.apache.maven:maven-core:jar:2.0.9
[ERROR] 4) org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-2
[ERROR] 
[JENKINS] Archiving /root/.jenkins/jobs/yes Core - NIGHTLY/workspace/yess/pom.xml to yes.pom
[ERROR] 14) org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-2
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-http-shared -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 

1 个答案:

答案 0 :(得分:0)

插件的定义如下:

<project>
    ...
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    ...
</project>

依赖项定义了项目的依赖关系以及Maven或其插件的