[英]Maven compiler plugin: Compilation failure
When I execute any goal from compile onwards, it fails to compile my ui sub pom project. 从编译开始执行任何目标时,都无法编译ui sub pom项目。 Just keeping the source/dir naming very bland, sorry.
抱歉,仅将源/目录命名保持平淡。 But the formatting is pretty much like this:
但是格式几乎是这样的:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project ui: Compilation failure: Compilation failure: [错误]无法在项目ui上执行目标org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile(默认编译):编译失败:编译失败:
[ERROR] could not parse error message: [parsing started C:\\Path\\Of\\My\\Project\\src\\main\\java\\com\\ui\\javaFile.java] [错误]无法解析错误消息:[分析开始的C:\\ Path \\ Of \\ My \\ Project \\ src \\ main \\ java \\ com \\ ui \\ javaFile.java]
[ERROR] [parsing completed 16ms] [错误] [解析完成16毫秒]
This same error with parsing gets done for all my java source files. 我所有的Java源文件都遇到了与解析相同的错误。 Later on in the spam of ERRORs it says things like:
后来在ERROR的垃圾邮件中,它显示如下内容:
[ERROR] C:\\Path\\Of\\My\\Project\\ui\\src\\main\\java\\com\\ui\\javaFile.java:[13,20] package javax.servlet does not exist [错误] C:\\ Path \\ Of \\ My \\ Project \\ ui \\ src \\ main \\ java \\ com \\ ui \\ javaFile.java:[13,20]包javax.servlet不存在
Does this mean it's failing to compile because I lack some needed dependencies? 这是否意味着由于缺少所需的依赖关系而导致编译失败?
My JAVA_HOME under Environment Variables is set to C:\\Program Files\\Java\\jdk1.6.0_43 and my Path has %JAVA_HOME%\\bin stuck to it. 我的环境变量下的JAVA_HOME设置为C:\\ Program Files \\ Java \\ jdk1.6.0_43,并且我的路径上有%JAVA_HOME%\\ bin附着在其中。 Also my parent pom has:
另外我的父母pom有:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler.plugins</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
And just for safety, it's in the normal plugins element too. 为了安全起见,它也在普通的plugins元素中。 I know for a fact my sub pom for the ui project references the parent pom correctly.
我知道,我的ui项目的子pom正确引用了父pom。
Not sure what else to think of :( 不知道还有什么要考虑的:(
Go easy on me guys! 你们放轻松吧! I'm quite the Maven rookie.
我是Maven新秀。 Having to convert an Ant build.xml project to Maven.
必须将Ant build.xml项目转换为Maven。 Would love some advice :)
会喜欢一些建议:)
Maven signals, that there is no servlet-api
dependency in your pom.xml. Maven表示,您的pom.xml中没有
servlet-api
依赖性。
I would suggest you to include the following dependency to your pom.xml 我建议您将以下依赖项包含到pom.xml中
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.