Eclipse的"问题"选项卡显示此错误:
描述:Java编译器级别与已安装的Java项目构面的版本不匹配.
资源:灌浆
路径:[空白]
位置:未知
类型:分面项目问题(Java版本不匹配)
我pom.xml有这个设置:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)
设置还可能在哪里不匹配?
我正在使用Eclipse开发Web应用程序,并使用maven原型生成项目.
当我启用maven依赖管理时,Eclipse会在pom文件中标记一些错误,这个错误是:
Multiple annotations found at this line:
- Execution default-testResources of goal org.apache.maven.plugins:maven-resources- plugin:2.4.3:testResources failed:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect
dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-
plugin:2.4.3:testResources:default-testResources:process-test-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(execution: default-compile, phase: compile)
- CoreException: Could not get the value for parameter compilerId for plugin execution default-compile:
PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be
resolved: Failed to collect dependencies for …Run Code Online (Sandbox Code Playgroud) 正如标题所提到的,我有以下问题:我用Eclipse用Maven Nature,当我更新我的Maven项目,我得到这个错误:
在"正在更新Maven项目"期间发生内部错误.
不支持的IClasspathEntry种类= 4
总是回来的解决方案如下:
mvn eclipse:clean (项目在eclipse/STS中打开)mvn eclipse:eclipse下一个)现在,我详尽地尝试了几次所有组合.但我总是得到上述错误.当我不得不进行mvn eclipse:eclipse项目时,错误开始发生.在使用m2eclipse功能并在eclipse中设置所有内容之前总是运行正常.
好的.我厌倦了这个问题.这必须有一个简单的解决方案,我很确定!我希望SO可以帮助我彻底摆脱这一切!
题
我们如何让Eclipse停止尝试处理/编译特定项目目录下的所有文件?目标是在问题视图中没有错误/警告,如果它们与此文件夹或其子文件夹中的某些内容相关.
背景
我们运行Eclipse 3.6,m2eclipse插件v0.10.2.20100623管理我们的autobuild.由于我无法控制的原因,我们在SVN项目目录下有完整的BlazeDS发行版src/main/resources/blazeds.从本质上讲,这个目录包含一个运行blazeds的tomilla的vanilla发行版,当我们通过SCP部署到我们的服务器时,我们将添加所有配置和项目文件.
因此,当我们运行deploy时,这个版本的tomcat被复制到服务器,我们的项目被放在里面.Tomcat和我们的RIA应用程序工作,一切都很好.
问题是,Eclipse src/main/resources/blazeds在运行AutoBuild时尝试编译所有内容,这会在我们的问题视图中生成大约300个错误/警告.因此,当真实的错误出现时,它会在噪声中丢失.
这些错误代码从茎中/blazeds/tomcat/webapps/samples/testdrive-datapush,也是testdrive-httpservice,traderdesktop例如web应用.它们具有不在类路径上的依赖源代码和未包含在库中的jar.
尝试失败的解决方案
我正在尝试推动正确的解决方案:完全移除样品,并从我们的版本控制中获取blazeds.这不会很快发生.
我在这里遵循了SO的答案,但这只是一个非常临时的解决方案.我已经尝试过在我能想到的任何地方添加排除项目,我的团队的其他成员也做了同样的事情.我已删除src/main/resources作为源目录(在首选项> Java构建路径>源选项卡中)我已blazeds在资源目录下添加了排除项.我试过的每一个排列blazeds,并**作为*blazeds*,**/blazeds/**等等.
我甚至尝试过包含编译器抱怨的库和源文件,但是如果不过度修改我们的项目配置,我就无法做到正确.
摘要
这必须简单.排除在eclipse项目中产生警告/错误的文件夹的常规方法是什么?
更新#1:
下面的gedim解决方案是不错的但它
1)不清除项目中的红色X
2)是我们团队中的每个人都需要手动改变
(即,它不在项目属性文件中;因此,它没有检查到subversion)
我希望通过告诉Eclipse该目录不包含
要编译/验证的项目来解决核心问题.这样的更改可能会出现在其中一个项目设置文件中.
下图显示了我想要清除的红色X,这
Build Path > Exclude
不是一个选项......

在Eclipse Juno中,我安装了最新的m2e插件(1.2.20120903-1050).在首选项中,我在Java中添加了jdk1.7.0_11 - > Installed JREs - > Add,然后指定了location(C:\Program Files\Java\jdk1.7.0_11).当我创建一个新的Maven项目并运行它时,我收到一个警告:
构建路径指定执行环境J2SE-1.5.工作区中没有安装与此环境严格兼容的JRE.
我不知道如何解决这个问题.
我相信这是一个Maven问题,因为我在运行普通的Java项目时没有这个错误.我在这里读到我应该更改"maven-compiler-plugin.pom"并将源和目标从1.5改为更合适的东西.就我而言,1.7.我已经这样做了,但我仍然收到警告.
我在Eclipse Indigo的checkout Maven项目中遇到了问题.我已经安装了m2e插件,Subclipse,Git,但是无法选择合适的SCM类型?怎么解决这个?

我正在尝试使用此处描述的解决方案来解决恼人的"生命周期配置未涵盖的插件执行:org.codehaus.mojo:build-helper-maven-plugin:1.7:add-source(执行:默认,阶段:生成 -来源)"当我将以下插件放在我的pom.xml上时:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals><goal>add-source</goal></goals>
<configuration>
<sources>
<source>src/bootstrap/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
但是当我运行mvn clean install时,我得到了这个:
原因:在存储库中找不到POM'org.eclipse.m2e:lifecycle-mapping':无法从任何存储库下载工件
有没有人知道如何让m2e和maven开心?
为了使m2e 1.0正常工作,我必须指定生命周期映射:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<versionRange>[2.0.2,)</versionRange>
<goals>
<goal>process</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Run Code Online (Sandbox Code Playgroud)
但后来我收到了这个警告:
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
Run Code Online (Sandbox Code Playgroud)
如果我运行一些特定的maven任务例如mvn clean install findbugs:findbugs(如果我只运行mvn clean install那么没有这样的消息)
我知道问题是这个POM不存在,因为它只被定义为保存映射信息.( …
我正在尝试Dynamic Web Application使用Java 8(以及Wildfly appServer,如果这很重要)构建一个eclipse,但是我无法让Eclipse Luna M5使用Java 8(我确实安装了Java 8 BETA支持,它适用于JavaSE项目).
在我的POM中,我将级别设置为Java 8:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
但在我这样做后,maven -> update project我收到以下错误:
Could not update project ExampleApp configuration
Version 1.8 of project facet java does not exist.
Run Code Online (Sandbox Code Playgroud)
事实上,没有java 1.8项目方面 project->preferences->project facets->java
我可以手动创建这样的facet并将它添加到eclipse或者我将不得不等到java 8发布并且eclipse的人决定添加它吗?
我在eclipse中得到以下错误:
persistence.xml文件没有可识别的内容.
我的persistence.xml文件在我的应用程序中运行良好,但eclipse不断给我这个错误.移动文件并使用m2eclipse更新我的项目配置后,我得到了这个.我没有更改文件本身.谁知道如何解决这个问题?
persistence.xml中:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="localDB" transaction-type="RESOURCE_LOCAL">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>package.Users</class>
<properties>
<!-- enable warnings for debugging -->
<property name="openjpa.Log" value="DefaultLevel=TRACE, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
<!-- connection properties -->
<property name="openjpa.ConnectionURL" value="jdbc:mysql://localhost/test"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionUserName" value="root"/>
<property name="openjpa.ConnectionPassword" value=""/>
</properties>
</persistence-unit>
</persistence>
Run Code Online (Sandbox Code Playgroud)
更新
看起来像m2eclipse中的一个bug与jpa结合使用.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=251323
通过设置选项暂时解决,将其显示为警告而不是错误