[英]m2e: copy-dependencies is not supported by m2e
I get this error in my pom.xml
, and I can't understand what I need to change in order to get eclipse to run the project (run as -> maven build) 我在我的
pom.xml
收到此错误,我无法理解为了让eclipse运行项目需要更改的内容(运行为 - > maven build)
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.cc.adapter.mock.InsertAccountStarter</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<!-- Line below is the error -->
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>${cxf.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-sources</id>
<configuration>
<sourceRoot>src/main/generated</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>src/main/wsdl/CrmService.wsdl</wsdl>
<autoNameResolution>true</autoNameResolution>
<extendedSoapHeaders>true</extendedSoapHeaders>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
The error when trying to build it from within eclipse is 尝试从eclipse中构建它时的错误是
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1]
I would really appreciate any help! 我真的很感激任何帮助!
To resolve this error all you need to do is copy following code just before your closing tag of build. 要解决此错误,您只需在构建结束标记之前复制以下代码即可。
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<versionRange>
[2.0,)
</versionRange>
<goals>
<goal>unpack</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
I have the same problem as yours 我和你的问题一样
When you want to compile your Maven project using m2eclipse plugin, try 当你想使用m2eclipse插件编译你的Maven项目时,试试吧
Run as -> Maven Build 运行为 - > Maven Build
then type compile in Goals 然后在Goals中输入compile
From the error message above, it appears that you have tried the Run as -> Maven Build
without specifying which maven goal
to run. 从上面的错误消息中,您似乎已经尝试了
Run as -> Maven Build
而没有指定要运行的maven goal
。
You should try a specific maven goal - Run as -> Maven install
or Run as -> Maven test
. 您应该尝试特定的maven目标 -
Run as -> Maven install
或Run as -> Maven test
。 Alternately, you can provide a goal in the Maven Build configuration
. 或者,您可以在
Maven Build configuration
提供目标。
Now, as for the warning, copy-dependencies is not supported by m2e
, it means that m2e does not support this plugin. 现在,至于警告,
copy-dependencies is not supported by m2e
,这意味着m2e不支持此插件。 Not all the maven functionality are currently supported by m2e. m2e目前不支持所有maven功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.