2015-09-07 257 views
0

我不知道爲什麼,並已閱讀了許多關於此的文章。但是我把與java版本相關的每個部分都設置爲1.7。maven編譯失敗

,但它仍然出現錯誤

[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: \65279 
[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: \65279 
[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: \65279 
[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: \65279 
[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: \65279 
[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: \65279 
[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) 

這裏是我的行家登錄

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

UPDATE

我添加了最相關的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> 
+0

你能顯示關於你的pom文件的更多信息嗎? – Rodolfo

+0

謝謝。 @Rodolfo pom文件的哪個部分要我添加? :D – verystrongjoe

+0

你試過mvn乾淨嗎? –

回答

1

的一部分,我不知道,如果你的POM具有sourceEncoding屬性,雖然你把maven.complier.plugin編碼配置,我用它來指定sourceEncoding到性能Maven的部分。

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 

Maven的錯誤輸出中抱怨\ 65279字,here你可以找到這種性格意味着和關於它的一些解釋。也許你必須使用另一個文本編輯器。