[英]M2Eclipse (M2E) build errors
I have installed the m2e
plugin for Eclipse and used it to create a simple archetype. 我已经为Eclipse安装了
m2e
插件,并使用它来创建一个简单的原型。 I wrote a small test driver and am trying to build the project (via Maven) and compile my Java sources into class files. 我编写了一个小型测试驱动程序,并试图构建该项目(通过Maven)并将Java源代码编译为类文件。
I go to Run >> Run Configurations
and create a New Maven Build
. 我转到
Run >> Run Configurations
并创建一个New Maven Build
。 I name it and set its base directory to be my project root. 我将其命名,并将其基本目录设置为我的项目根目录。
When I try to select Goals
it doesn't see any and so I can't add/specify any. 当我尝试选择
Goals
时,看不到任何Goals
,因此无法添加/指定任何目标。 I click the Run
button. 我单击
Run
按钮。 Here is my console output: 这是我的控制台输出:
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.me:myproject:0.0.1-SNAPSHOT (C:\Users\me\workbench\eclipse\workspace\MyProject\pom.xml) has 3 errors
[ERROR] 'build.plugins.plugin.artifactId' is missing. @ line 145, column 17
[ERROR] 'build.plugins.plugin.groupId' is missing. @ line 144, column 14
[ERROR] 'build.plugins.plugin.version' for : must be a valid version but is ''. @ line 146, column 14
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
The <build>
tag in my pom.xml is: 我的pom.xml中的
<build>
标记是:
<build>
<plugins>
<plugin>
<groupId></groupId>
<artifactId></artifactId>
<version></version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compiler:compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
A few things: 一些东西:
artifactId
, groupId
and version
be if this is the (standard) Maven compile
phase? compile
阶段,我的artifactId
, groupId
和version
应该是什么? Run Configurations
)? Run Configurations
)吗? In Ant there is a plugin that lets you see all of the targets defined in your build.xml
; build.xml
定义的所有目标。 I see no such analog in Maven/m2e. You don't need to put anything as you are using all the defaults settings of the maven compiler. 使用maven编译器的所有默认设置时,无需放置任何内容。 If you really want to specify it you can do it this way:
如果您确实要指定它,则可以通过以下方式进行操作:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.