maven-dependency-plugin 报错

maven-dependency-plugin 报错

问题描述:

org.apache.maven.plugin.MojoExecutionException: Artifact has not been packaged yet. When used on reactor artifact, copy should be executed after packaging: see MDEP-187.
pom中报错内容如上, 下面是我配的插件代码 .有解决过的请帮忙回答下 ,谢谢

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.9</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/lib</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

解决了, IDE的问题, STS上出现ECLIPSE中就没事, 而且两边都不影响发布.
只是看着不爽.

到你的maven的本地库中,找到这个jar包所在的文件夹,能不能找到相应版本的jar包

有可能没有下载完整,建议你把那个文件夹下的文件都删除,重新update一下maven

虽然这个不怎么影响使用,确实看到种错误很不爽,把maven库的包删除 重新下载即可。