使用maven设置Eclipse的项目 [英] Setting project for eclipse using maven
问题描述
[INFO]资源目录的路径与现有的源目录相匹配。资源将被合并到源目录src / main / resources
[INFO] ------------------------------ ------------------------------------------
[错误] BUILD错误
[INFO] ------------------------------------------ ------------------------------
[INFO]当过滤不相同时请求合并。原始=资源src / main / resources:output = target / classes,include = [atlassian-plugin.xml],exclude = [** / *。java],test = false,filters = true,
合并= resource src / main / resources:output = target / classes,include = [],exclude = [atlassian-plugin.xml | ** / *。java],test = false,filters = false
[INFO] -------------------------------------------------- ----------------------
[INFO]跟踪
org.apache.maven.lifecycle.LifecycleExecutionException:当过滤时请求合并不一样原始=资源src / main / resources:output = target / classes,include = [atlassian-plugin.xml],
exclude = [** / *。java],test = false,filters = true, = resource src / main / resources:output = target / classes,include = [],exclude = [atlassian-plugin.xml | ** / *。java],test = false,filters = false
在org。 apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
在org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
在org.apache.maven。 lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
在org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
在org.apache.maven.lifecycle.DefaultLifecycleExecutor。 executeTaskSegments(DefaultLifecycleExecutor.java:291)
在org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleEx ecutor.java:142)
在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
在java.lang.reflect.Method.invoke(Method.java:597)
在org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
在org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
在org.codehaus.classworlds.Launcher .mainWithExitCode(Launcher.java:430)
在org.codehaus.classworlds.Launcher.main(Launcher.java:375)
导致:org.apache.maven.plugin.MojoExecutionException:请求合并当'过滤是不相同的。原始=资源src / main / resources:output = target / classes,include = [atlassian-plugin.xm
l],exclude = [** / *。java],test = false,filters = true, = resource src / main / resources:output = target / classes,include = [],exclude = [atlassian-plugin.xml | ** / *。java],test = false,filters = false
在org。 apache.maven.plugin.eclipse.EclipseSourceDir.merge(EclipseSourceDir.java:302)
在org.apache.maven.plugin.eclipse.EclipsePlugin.extractResourceDirs(EclipsePlugin.java:1605)
在org。 apache.maven.plugin.eclipse.EclipsePlugin.buildDirectoryList(EclipsePlugin.java:1490)
在org.apache.maven.plugin.eclipse.EclipsePlugin.createEclipseWriterConfig(EclipsePlugin.java:1180)
在org。 apache.maven.plugin.eclipse.EclipsePlugin.writeConfiguration(EclipsePlugin.java:1043)
在org.apache.maven.plugin.ide.AbstractIdeSupportMojo.execute(AbstractIdeSupportMojo.java:511)
在org。 apache.maven.plugin.DefaultPluginManager.execut (默认值为>
这会使它更好吗?
mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse
这告诉maven使用版本2.6(仍然可以工作),而不是默认的2.7(不会)。
你必须发出每次这样的命令,所以这有点不方便,而上面的文件更改应该会导致一次性修复,但是这样你不会意外地打破别的东西,你不必去寻找文件。
如果您不记得命令语法,请将其复制到文本文件中以便于参考。
请参阅这个线程。
它提到了Maven Eclipse插件最近的变化:
I'm trying to start modifying an existing application with Eclipse. Actually I had it working before, but I deleted the project, and now with "mvn eclipse:eclipse" I get the following:
[INFO] Resource directory's path matches an existing source directory. Resources will be merged with the source directory src/main/resources
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Request to merge when 'filtering' is not identical. Original=resource src/main/resources: output=target/classes, include=[atlassian-plugin.xml], exclude=[**/*.java], test=false, filtering=true,
merging with=resource src/main/resources: output=target/classes, include=[], exclude=[atlassian-plugin.xml|**/*.java], test=false, filtering=false
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Request to merge when 'filtering' is not identical. Original=resource src/main/resources: output=target/classes, include=[atlassian-plugin.xml],
exclude=[**/*.java], test=false, filtering=true, merging with=resource src/main/resources: output=target/classes, include=[], exclude=[atlassian-plugin.xml|**/*.java], test=false, filtering=false
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Request to merge when 'filtering' is not identical. Original=resource src/main/resources: output=target/classes, include=[atlassian-plugin.xm
l], exclude=[**/*.java], test=false, filtering=true, merging with=resource src/main/resources: output=target/classes, include=[], exclude=[atlassian-plugin.xml|**/*.java], test=false, filtering=false
at org.apache.maven.plugin.eclipse.EclipseSourceDir.merge(EclipseSourceDir.java:302)
at org.apache.maven.plugin.eclipse.EclipsePlugin.extractResourceDirs(EclipsePlugin.java:1605)
at org.apache.maven.plugin.eclipse.EclipsePlugin.buildDirectoryList(EclipsePlugin.java:1490)
at org.apache.maven.plugin.eclipse.EclipsePlugin.createEclipseWriterConfig(EclipsePlugin.java:1180)
at org.apache.maven.plugin.eclipse.EclipsePlugin.writeConfiguration(EclipsePlugin.java:1043)
at org.apache.maven.plugin.ide.AbstractIdeSupportMojo.execute(AbstractIdeSupportMojo.java:511)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
Would this make it better?
mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse
This tells maven to use version 2.6 (which still works) instead of the default 2.7 (which doesn't).
You'll have to issue the command like this every time, so it's a little inconvenient whereas the file changes above should result in a one-time fix, but this way you don't risk accidentally breaking something else and you don't have to go looking for files.
If you can't remember the command syntax, copy it into a text file for easier reference.
See this thread.
It does mention a recent change in the Maven Eclipse Plugin:
- MECLIPSE-551 regression - Resources are excluded if resource dir equals source dir
- MECLIPSE-551 Jira ticket
这篇关于使用maven设置Eclipse的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!