簡體   English   中英

安裝Maven插件作為依賴項?

[英]Install Maven plugin as a dependency?

我正在嘗試將特定的插件(maven-dependency-plugin)下載到特定的本地存儲庫。

我可以像將該其他插件添加為依賴項一樣,然后再運行mvn install嗎?

我問的原因是我一直在嘗試上面的方法,每當涉及到該插件的依賴項時,它都無法從Maven Central獲取它們,並且基本上只是不起作用:(

我的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] 

插件的定義如下所示:

<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或其插件的依賴關系。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM