我知道以前有人问过这个问题,但我仍在努力解决这个问题。当我将项目加载到 eclipse 中时,出现以下异常:
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.7:run (execution: generate-webapp-name, phase: compile)
Run Code Online (Sandbox Code Playgroud)
我的 maven 项目由许多模块(> 200)组成,它会导致所有模块出现问题。
我尝试忽略我的(在父模块中)run
和compile
目标pom.xml
:
<pluginManagement>
<plugins>
<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-antrun-plugin</artifactId>
<versionRange>[1.7,)</versionRange>
<goals>
<goal>compile</goal>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Run Code Online (Sandbox Code Playgroud)
但它仍然不起作用。
我刚刚从Helios切换到Eclipse Indigo,当尝试使用WTP在Tomcat 6上运行支持Maven的Web项目时,我遇到了一些麻烦.
我遇到了Tomcat没有看到Maven依赖项的经典问题.在Helios中,解决方法是通过以下方式将Maven依赖项添加到Deployment Assembly:项目属性 - >部署程序集 - >添加"Java构建路径条目" - > Maven依赖项
不幸的是,没有列出"Java Build Path Entries"的选项,只列出了"Folder"和"Project".我不确定这是故意的,还是我的设置有问题.
为了消除外部因素,我使用以下设置:
此时,我看到获取与我缺少的依赖项相关的ClassNotFoundException.如果我运行'mvn war:war'并在项目的部署程序集中包含已组装的'WEB-INF/lib'目录,那么当然可以正确地选择依赖项 - 对于快速修复来说很好,但并不理想.
我读到的与类似问题相关的大多数问题都归结为缺少WTP集成模块,但这对我来说似乎不是问题.
难道我做错了什么?
我在eclipse中有一个maven项目,有一些依赖项:
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.2.5-R1.2</version>
</dependency>
<dependency>
Run Code Online (Sandbox Code Playgroud)
一个(apache commons)来自核心存储库,但另一个来自其他一些maven服务器.
依赖项已成功导入,并显示在eclipse项目中.我可以commons-lang3-3.1.jar
在包浏览器中右键单击,然后单击Maven - > Open POM,打开pom文件.
但是,如果我这样做bukkit-1.2.5-R1.2.jar
,它会失败并显示以下消息:
[错误]无法解析工件org.bukkit:bukkit:pom:1.2.5-R1.2
令人困惑的部分是我可以打开eclipse创建的maven存储库索引,并看到所需的文件存在:
\.m2\repository\org\bukkit\bukkit\1.2.5-R1.2:
bukkit-1.2.5-R1.2.jar
bukkit-1.2.5-R1.2.jar.lastUpdated
bukkit-1.2.5-R1.2.jar.sha1
bukkit-1.2.5-R1.2.pom
bukkit-1.2.5-R1.2.pom.lastUpdated
bukkit-1.2.5-R1.2.pom.sha1
...
Run Code Online (Sandbox Code Playgroud)
为什么不能eclipse/m2e/maven找到并打开这个POM?
当我尝试构建或编译我的Maven项目时,我收到以下错误消息:
[ERROR] Failed to execute goal on project dss-services: Could not resolve dependencies for project net.jnd.thesis:dss-services:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [log4j:log4j:jar:1.2.16 (compile), org.slf4j:slf4j-api:jar:1.6.4 (compile), org.slf4j:jcl-over-slf4j:jar:1.6.4 (compile), org.slf4j:slf4j-log4j12:jar:1.6.4 (compile), net.sf.flexjson:flexjson:jar:2.1 (compile), commons-beanutils:commons-beanutils:jar:1.8.3 (compile), org.apache.commons:commons-lang3:jar:3.1 (compile), org.eclipse.jetty:jetty-websocket:jar:8.1.4.v20120524 (compile), net.jnd.thesis:dss-common:jar:0.0.1-SNAPSHOT (compile)]: Failed to read artifact descriptor for net.jnd.thesis:dss-common:jar:0.0.1-SNAPSHOT: Could not find artifact net.jnd.thesis:dss:pom:0.0.1-SNAPSHOT -> [Help 1]
Run Code Online (Sandbox Code Playgroud)
在我的研究期间,我发现了两种可能的解
然而,倘若不适用,因为我已经是答案从零重新创建的项目(我看不出如何改变目录的名称会有所帮助),因为我的错误信息,从这些具体案件提出的错误消息不同.
我认为,在我的Eclipse插件M2E必须有某种配置的问题,因此它不能下载或找到所需的Maven构件,但我对如何解决问题不知道:S
我有一个Web应用程序(Eclipse的动态Web应用程序),它使用Maven(m2e-wtp)进行构建和依赖项管理.这个Web应用程序的POM引用了我工作区中的一些其他项目,这些项目恰好是使用maven构建的eclipse插件(使用Tycho构建),以及来自Maven存储库的其他第三方库.
当我从CLI运行maven时,一切正常.所有依赖项都按预期包含在WEB-INF/lib目录中.
问题是当我尝试使用Eclipse运行项目时.我在Eclipse中配置的Tomcat服务器中运行应用程序,但我工作区中引用的项目未添加到已部署的war中.
我尝试将它们添加到部署程序集(在项目首选项下),并且完美地工作,但每次更新maven配置时,m2e都会清除这些设置.我在几个地方读到我们不应该手动添加条目,因为所有依赖项都应该由m2e管理...
问题是:当我从Eclipse运行时,如何让Eclipse将工作区项目依赖项添加到我的Web应用程序的WEB-INF/lib中?
我正在使用Eclipse J2EE 4.3.1(Kepler SR1).
我还尝试右键单击项目并选择Export - > WAR file,但导出的WAR文件也不包括引用的工作区项目.我假设这个问题影响了两个案例.
这非常令人讨厌,而且让我慢慢减速......此时我必须每天多次将项目重新添加到Deployment Assembly页面以保持它...
更新:我在POM中作为依赖项添加的工作空间项目出现在项目属性下的Referenced Projects列表中.但是,当我在Project Explorer中展开Maven依赖项时,列表中缺少工作区项目依赖项!只显示Maven存储库中的那些.他们当地人似乎默默地被忽视了......
我正在做一个骆驼项目.我开始采用骆驼示例,在shell中运行"mvn eclipse:eclipse",然后将其作为maven项目导入Eclipse.不幸的是,我在pom.xml中有一个警告:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel</groupId>
<artifactId>examples</artifactId>
<version>2.13.0</version>
</parent>
<artifactId>CruiserFoodSupply</artifactId>
<packaging>jar</packaging>
<name>Cruiser Food Supply</name>
<description>A process on how food supply on a cruiser works.</description>
<dependencies>
<!-- Camel dependencies -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
</dependency>
<!-- Mail -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-mail</artifactId>
</dependency>
<!-- XStream -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-xstream</artifactId>
</dependency>
<!-- Weather -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-weather</artifactId>
</dependency>
<!-- Many more dependencies-->
</dependencies>
<profiles>
<profile>
<id>Example</id>
<properties>
<target.main.class>org.apache.camel.example.jmstofile.CamelJmsToFileExample</target.main.class>
</properties>
</profile>
</profiles>
<build>
<plugins>
<!-- Allows the …
Run Code Online (Sandbox Code Playgroud) 在升级到Eclipse Luna或m2e 1.5.x并使用Maven插件项目打开现有工作区之后,Eclipse抱怨说
Plugin execution not covered by lifecycle configuration:
org.apache.maven.plugins:maven-plugin-plugin ...
Run Code Online (Sandbox Code Playgroud) 在我的Eclipse Luna SR2(4.4.2)中运行更新后,我安装了m2e 1.6.1.20150625-2338.对于我maven-war-plugin
现在使用的项目,我在问题视图中遇到以下错误:
全文:
冲突的生命周期映射(插件执行"org.apache.maven.plugins:maven-war-plugin:2.3:war(执行:war-standalone,phase:package)").要启用完整功能,请删除冲突的映射并运行Maven->更新项目配置.
冲突的生命周期映射(插件执行"org.apache.maven.plugins:maven-war-plugin:2.3:war(执行:war-standalone,phase:package)").要启用完整功能,请删除冲突的映射并运行Maven->更新项目配置.
插件配置不会导致以前版本的m2e出现问题.在pom看起来没问题,没什么不寻常的:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<executions>
<execution>
<id>war-standalone</id>
<goals>
<goal>war</goal>
</goals>
<phase>package</phase>
<configuration>
...
</configuration>
</execution>
<execution>
<id>war-overlay</id>
<goals>
<goal>war</goal>
</goals>
<phase>package</phase>
<configuration>
...
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
生命周期映射maven-war-plugin
未在pom中配置.我检查它是否在父母poms但找不到任何东西.None也在工作空间生命周期映射元数据中.
然后我注意到m2e-wtp插件(映射似乎来自)仍然是旧版本.我将其更新为1.2.0.20150602-1740,但它没有解决问题.
知道如何追踪冲突映射的位置或者如何正确解决问题?
我的eclipse安装总是使用https协议来下载存储库结构.问题是我的合作代理不会让我在这个网址上使用https.如何强制m2e使用http?
我尝试了m2e的不同外部maven装置,但没有运气.它只适用于我使用CLI的外部maven,后者使用http.
将maven项目导入Eclipse IDE全新安装时,会出现"Setup Maven插件连接"的弹出问题
如果不安装,将会出现pom.xml中显示的错误
生命周期配置未涵盖插件执行:org.eclipse.tycho:tycho-packaging-plugin:0.20.0:validate-id(执行:default-validate-id,阶段:validate)
如何在任何时候安装m2e配置器(例如在为团队准备Eclipse包之前,或者在交互式安装通过网络失败之后再次安装)?
eclipse ×10
m2e ×10
maven ×10
java ×3
m2e-wtp ×2
apache ×1
eclipse-luna ×1
eclipse-wtp ×1
maven-plugin ×1
pom.xml ×1