Инсталиране на приставката Maven като зависимост?

Опитвам се да изтегля конкретен плъгин (maven-dependency-plugin) в конкретно локално хранилище.

Мога ли просто да добавя този плъгин като зависимост, както бих направил всеки друг артефакт, след което да изпълня mvn install?

Причината, поради която питам, е, че опитвах горното и винаги, когато става въпрос за зависимостите на този плъгин, той не може да ги извлече от maven central и по същество просто не работи :(

моят пом:

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

person Ree    schedule 09.06.2014    source източник
comment
Версиите на зависимостите, които плъгинът има, изглежда не съществуват, когато преглеждам maven central...   -  person Ree    schedule 09.06.2014
comment
Моля, покажете съобщенията за грешка, които получавате, и как изглежда вашият pom файл?   -  person khmarbaise    schedule 09.06.2014
comment
грешката е грешка при изчакване в момента... което е различно от преди. първо ще опитам да получа старата грешка, тъй като смятам, че тази е по-подходяща   -  person Ree    schedule 10.06.2014
comment
Само един въпрос защо използвате толкова стари версии на плъгини? Коя версия на Maven използвате?   -  person khmarbaise    schedule 10.06.2014
comment
единствената версия на приставката, която посочих, беше тази на maven-dependency-plugin и само защото това беше тази на уебсайта на maven, предполагам: maven.apache.org/plugins/maven-dependency-plugin/examples/   -  person Ree    schedule 10.06.2014
comment
въпреки че има, вижте неговия 2.8, но получавам точно същите грешки, затова опитах 2.1   -  person Ree    schedule 10.06.2014
comment
Дефинирането на плъгин maven като зависимост няма смисъл. Освен това уебсайтът споменава 2.8. Изглежда не си разбрал идеята за Мейвън.   -  person khmarbaise    schedule 10.06.2014


Отговори (1)


Определение за плъгини изглежда така:

<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 или неговите добавки.

person khmarbaise    schedule 10.06.2014