admin管理员组

文章数量:1612150

使用mvn命令下载jar包的时候,有时候会报错:no plugin found for prefix 'dependency' in the current project and in the current project and in the plugin groups [org.apache.maven.plugins,org.codehaus.mojo] available from the repositories[local(E:\mavenlib)xxxxx]
原因是pom.xml里plugins没有添加copy-dependencies

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-dependency-plugin</artifactId>
   <version>2.8</version>
   <executions>
      <execution>
         <phase>package</phase>
         <goals>
            <goal>copy</goal>
            <goal>copy-dependencies</goal>
         </goals>
      </execution>

   </executions>
</plugin>

添加成功后,再次使用mvn命令即可。
顺便说下mvn copy 步骤

  1. 在pom.xml文件下配置上述代码中的plugin
  2. 打开pom.xml所在的文件夹
  3. 按住shift,右键 —> 在此处打开命令窗口
  4. 使用命令:mvn dependency:copy-dependencies -DoutputDirectory=f:\lib -DincludeScope=compile

本文标签: 报错dependenciesCopyDependencymvn