2013-11-29 61 views
1

它安裝在我第一次使用MVN請編譯 我行家:MVN編譯錯誤無效換行符

Maven home: D:\android\apache-maven-3.1.1 
Java version: 1.7.0_40, vendor: Oracle Corporation 
Java home: C:\Program Files\Java\jdk1.7.0_40\jre 
Default locale: zh_CN, platform encoding: GB18030 
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows" 

我從https://github.com/netty/netty下載一個網狀的項目。

後我跑MVN編譯,錯誤如下 ..

\netty-3.8.0.Final\src\main\java\org\jboss\netty\util\Vi 
rtualExecutorService.java:0: invalid newline character (expected: CRLF) 

..

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin: 
2.9.1:check (check-style) on project netty: Failed during checkstyle execution: 
There are 1346 checkstyle errors. -> [Help 1] 

回答

0

Checkstyle的錯誤並不嚴重。您可以禁用的CheckStyle插件,把<skip>true</skip>在pom.xml文件:

<project> 
    ... 
    <build> 
    ... 
    <plugins> 
     ... 
     <plugin> 
     <artifactId>maven-checkstyle-plugin</artifactId> 
     <configuration> 
      <skip>true</skip> 
     </configuration> 
     </plugin> 
     ... 
    </plugins> 
    ... 
    </build> 
    ... 
</project> 

那麼該項目應能夠成功的建立。

如果你不想改變你的pom.xml您可以在命令行中使用-D選項跳過設置爲true(重寫執行中跳過參數):

mvn compile -Dcheckstyle.skip=true