问答

解决插件’maven-dependency-plugin:2.8’的版本时出错

 来源    2019-04-11    758  

我试图从互联网安装一个原型,需要执行mvn maven-dependency-plugin:2.8:copy.由于错误重新发布版本,它无法正常工作.我在本地也有一个正确的版本存储库到我的服务器.我的mvn捆绑到我的服务器上的nexus.

怎么了?

错误信息:

mvn -e maven-dependency-plugin:2.8:copy
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.131s
[INFO] Finished at: Wed Jul 24 11:15:01 CEST 2013
[INFO] Final Memory: 5M/149M
[INFO] ------------------------------------------------------------------------
[ERROR] Error resolving version for plugin 'maven-dependency-plugin:2.8' from the repositories [local (/home/argonist/.m2/repository), nexus (http://10.8.1.1:8081/nexus/content/groups/public)]: Plugin not found in any plugin repository -> [Help 1]
org.apache.maven.plugin.version.PluginVersionResolutionException: Error resolving version for plugin 'maven-dependency-plugin:2.8' from the repositories [local (/home/argonist/.m2/repository), nexus (http://10.8.1.1:8081/nexus/content/groups/public)]: Plugin not found in any plugin repository
    at org.apache.maven.plugin.version.internal.DefaultPluginVersionResolver.selectVersion(DefaultPluginVersionResolver.java:237)
    at org.apache.maven.plugin.version.internal.DefaultPluginVersionResolver.resolveFromRepository(DefaultPluginVersionResolver.java:149)
    at org.apache.maven.plugin.version.internal.DefaultPluginVersionResolver.resolve(DefaultPluginVersionResolver.java:97)
    at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.resolvePluginVersion(MojoDescriptorCreator.java:277)
    at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:232)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:98)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginVersionResolutionException

本地存储库:

ll /home/argonist/.m2/repository/org/apache/maven/plugins/maven-dependency-plugin/2.8/
insgesamt 188
drwxrwxr-x 2 argonist argonist   4096 Jul 24 10:24 ./
drwxrwxr-x 5 argonist argonist   4096 Jul 24 10:23 ../
-rw-rw-r-- 1 argonist argonist    107 Jul 24 11:14 m2e-lastUpdated.properties
-rw-rw-r-- 1 argonist argonist 153185 Jul 24 10:23 maven-dependency-plugin-2.8.jar
-rw-rw-r-- 1 argonist argonist     40 Jul 24 10:23 maven-dependency-plugin-2.8.jar.sha1
-rw-rw-r-- 1 argonist argonist  11454 Jul 24 10:23 maven-dependency-plugin-2.8.pom
-rw-rw-r-- 1 argonist argonist     40 Jul 24 10:23 maven-dependency-plugin-2.8.pom.sha1
-rw-rw-r-- 1 argonist argonist    205 Jul 24 10:23 _maven.repositories

更新

mvn -e org.apache.maven.plugins:maven-dependency-plugin:2.8:copy
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:copy (default-cli) @ standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.416s
[INFO] Finished at: Wed Jul 24 17:15:39 CEST 2013
[INFO] Final Memory: 9M/149M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (default-cli) on project standalone-pom: Either artifact or artifactItems is required -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (default-cli) on project standalone-pom: Either artifact or artifactItems is required
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoFailureException: Either artifact or artifactItems is required
    at org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.verifyRequirements(AbstractFromConfigurationMojo.java:125)
    at org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.doExecute(CopyMojo.java:103)
    at org.apache.maven.plugin.dependency.AbstractDependencyMojo.execute(AbstractDependencyMojo.java:167)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

更新

的pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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>org.glassfish.samples</groupId>
    <artifactId>javaee7-jms-websocket-example</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>javaee7-jms-websocket-example</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-websockets-jsr</artifactId>
            <version>1.0.0.Alpha13</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>7.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

试试这个..你应该给出完全限定的名称,即groupId:artifactId:version

mvn -e org.apache.maven.plugins:maven-dependency-plugin:2.8:copy

有关更多参考,请参阅maven中央回购.

http://search.maven.org/#search|ga|1|maven-dependency-plugin

相关文章
Maven Release Plugin – 准备创建Snapshot版本的代码,而不是发布版本
问答我有以下项目结构: >框架 > framework-parent-pom 框架 – 东西 > - 在框架父pom的pom.xml中我已经定义了以下插件: <plugin> ...
3
VirtualBox – Ubuntu – Maven – trustAnchors参数必须为非空时出错
问答对于使用Aerospike的项目,我需要使用maven. 我正在尝试安装此批次 https://www.aerospike.com/docs/tools/asloader/index.html 我正在 ...
4
Ant/Maven:“javadoc:warning – 获取URL时出错”
问答我最近设置了我的构建服务器(Jenkins)来为Ant构建生成Javadocs.但是,无论我做什么,我都无法包含外部库的链接.当我尝试使用在线链接时,Ant返回: [javadoc] javadoc: ...
1
使用ADT 20将Maven Android Android项目导入到Eclipse时出错
问答我将ADT插件更新到最新版本(20)和android-sdk工具.现在,当我尝试导入一个现存的Android Maven到Eclipse引发异常时出现内部错误:"导入Maven项目" ...
1
maven – 尝试在cmd中查看mvn版本时出错
问答尝试在cmd中输入"mvn -version"时,我不断收到此错误. Exception in thread "main" java.lang.NoClassD ...
1
java – Maven Jar Plugin和Maven Assembly插件有什么区别?
问答有人可以向我解释这两个Maven插件之间的完全不同之处,以及何时使用这些插件之一呢? 非常感谢 !::Maven jar插件只需创建一个包含所有源文件[.class文件从.java文件编译而成)的ja ...
2
Maven如何解决插件版本?
问答我正在阅读the docs并且仍然对Maven如何决定下载哪个版本的插件感到困惑. 例如,考虑这个简单的场景: >一个空的本地存储库 >默认的settings.xml >运行一个简单 ...
2
java – Log4j2自定义插件 – 使用Maven Assembly Plugin进行注释处理
问答我对Maven不太熟悉,我昨天开始使用它,但我喜欢它.在我的项目中,我使用Log4j2库进行日志记录,由于高级插件(如appender,转换器)的不足,我需要使用自定义插件. log4j-api和lo ...
1
解决Jetty Maven Plugin:Please initialize the log4j system properly(转)
日志解决Jetty Maven Plugin:Please initialize the log4j system properly.Jetty Maven Plugin环境: <plugin> ...
2
施用 maven shade plugin 解决 jar 或类的多版本冲突
日志施用 maven shade plugin 解决 jar 或类的多版本冲突 使用 maven shade plugin 解决 jar 或类的多版本冲突java 应用经常会碰到的依赖的三方库出现版本冲突 ...
1
[Maven] - Eclipse "maven compiler plugin" 冲突解决
日志刚安装最新的Maven 3.2.5,在eclipse中使用maven的Run As->Maven Install,总会提示: Failed to execute goal org.apache. ...
2
Jenkins安装maven integration plugin失败解决方法
日志最近装了一个jenkins准备搞一个自动化测试的持续集成,但是在安装maven integration这个插件时报错,试了几次都是失败! 错误原因如下: javadoc安装失败: java.io.IO ...
1
解决Maven报Plugin execution not covered by lifecycle configuration
日志当在plugins中添加新的插件时,一直报Plugin execution not covered by lifecycle configuration错误. 解决方法: 方法一.在<plugi ...
1
解决Maven报Plugin execution not covered by lifecycle configuration问题
日志问题: 在eclipse neon 中引入maven项目时,弹出两个错误,一个是jacco-maven-plugin,一个是项目中的插件ota-schema-plugin  如果忽略这两个错误,点击f ...
2
java – 为什么Maven Assembly Plugin不包含带有依赖项的jar中的项目文件?
问答我使用maven assembly plug in打包我的项目及其所有依赖项,所以我可以运行一个简单的java -jar myproject.jar并能够运行该项目.但是,当我运行它时,它告诉我 Er ...
98
jmeter插件maven测试罐
问答嗨,我正在尝试使用lazerycode的jmeter-maven-plugin自动化我的JMeter负载平衡测试.我的JMeter测试使用premade junit类文件,我将其打包到带有maven- ...
2
部署 – gradle-release插件maven发布插件
问答我正在创建gradle构建作为新的gradle用户,但我过去曾与maven合作过. 我正在尝试重现maven发布插件的操作: >将分支版本更改为版本号(在svn提交) >创建一个标签(在s ...
2
Local Maven Dependency项目被引用为类文件夹而不是jar
问答我正在使用Eclipse Indigo和m2e插件(版本1.0.1).我有两个独立的工作区项目:Maven项目基本上是Vaadin小部件,第二个Maven项目是我的主要项目,它引用该小部件: < ...
1
java – 查找特定插件的Maven存储库中可用的版本列表?
问答给定我的pom.xml中的以下存储库URL如何确定在存储库中有哪些最新版本的spring和hibernate可用? http://repo1.maven.org/maven2::编程还是只是手动? 由 ...
2