maven编译失败
Compilation failure in maven
我不知道为什么,已经阅读了很多关于此的文章。但是我将与设置 java 版本相关的每个部分都设置为 1.7.
但是还是报错
[WARNING] The requested profile "anyframe" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project faro-jpa: Compilation failure: Compilation failure:
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/workgroupmgn/service/impl/WorkgroupMgnServiceImpl.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/workgroupmgn/service/impl/WorkgroupMgnServiceImpl.java:[1,10] class, interface, or enum expected
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/logmgn/dao/impl/LogMgnDaoImpl.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/logmgn/dao/impl/LogMgnDaoImpl.java:[1,10] class, interface, or enum expected
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/language/dao/impl/LanguageMgnDaoImpl.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/language/dao/impl/LanguageMgnDaoImpl.java:[7,9] class, interface, or enum expected
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/language/service/impl/LanguageMgnServiceImpl.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/language/service/impl/LanguageMgnServiceImpl.java:[7,9] class, interface, or enum expected
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/common/session/FaroUserSessionHolder.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/common/session/FaroUserSessionHolder.java:[7,9] class, interface, or enum expected
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/common/util/file/vo/NameMappingVo.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/common/util/file/vo/NameMappingVo.java:[1,10] class, interface, or enum expected
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project faro-jpa: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
这是我的 maven 日志
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T22:51:42+09:00)
Maven home: D:\dev\ide\apache-maven-3.2.2
Java version: 1.8.0_40, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_40\jre
Default locale: ko_KR, platform encoding: UTF-8
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
[INFO] Error stacktraces are turned on.
并且我把这个项目的jre系统库设置为java 7.
更新
我添加了最相关的部分 pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<!-- <file>${system.score.path}/querydsl-apt-3.4.3.jar</file> -->
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<!-- <systemPath>${system.score.path}/querydsl-apt-3.4.3.jar</systemPath> -->
</dependency>
</dependencies>
</plugin>
我不知道你的pom有没有sourceEncoding
属性,虽然你把编码配置放在maven.complier.plugin
,我用在properties maven部分指定sourceEncoding
.
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
你的 maven 错误输出抱怨 \65279 字符,here你可以找到这个字符的含义和一些解释。也许你必须使用另一个文本编辑器。
我不知道为什么,已经阅读了很多关于此的文章。但是我将与设置 java 版本相关的每个部分都设置为 1.7.
但是还是报错
[WARNING] The requested profile "anyframe" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project faro-jpa: Compilation failure: Compilation failure:
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/workgroupmgn/service/impl/WorkgroupMgnServiceImpl.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/workgroupmgn/service/impl/WorkgroupMgnServiceImpl.java:[1,10] class, interface, or enum expected
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/logmgn/dao/impl/LogMgnDaoImpl.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/logmgn/dao/impl/LogMgnDaoImpl.java:[1,10] class, interface, or enum expected
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/language/dao/impl/LanguageMgnDaoImpl.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/language/dao/impl/LanguageMgnDaoImpl.java:[7,9] class, interface, or enum expected
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/language/service/impl/LanguageMgnServiceImpl.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/admin/module/language/service/impl/LanguageMgnServiceImpl.java:[7,9] class, interface, or enum expected
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/common/session/FaroUserSessionHolder.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/common/session/FaroUserSessionHolder.java:[7,9] class, interface, or enum expected
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/common/util/file/vo/NameMappingVo.java:[1,1] illegal character: 279
[ERROR] /D:/workspace/camel/faro-jpa/src/main/java/com/sds/redca/hub/common/util/file/vo/NameMappingVo.java:[1,10] class, interface, or enum expected
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project faro-jpa: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
这是我的 maven 日志
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T22:51:42+09:00)
Maven home: D:\dev\ide\apache-maven-3.2.2
Java version: 1.8.0_40, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_40\jre
Default locale: ko_KR, platform encoding: UTF-8
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
[INFO] Error stacktraces are turned on.
并且我把这个项目的jre系统库设置为java 7.
更新
我添加了最相关的部分 pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<!-- <file>${system.score.path}/querydsl-apt-3.4.3.jar</file> -->
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<!-- <systemPath>${system.score.path}/querydsl-apt-3.4.3.jar</systemPath> -->
</dependency>
</dependencies>
</plugin>
我不知道你的pom有没有sourceEncoding
属性,虽然你把编码配置放在maven.complier.plugin
,我用在properties maven部分指定sourceEncoding
.
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
你的 maven 错误输出抱怨 \65279 字符,here你可以找到这个字符的含义和一些解释。也许你必须使用另一个文本编辑器。