2011-07-06 2 views
6

Maven으로 컴파일 할 때 항상 컴파일러 경고 및 사용 중단을 표시하고 싶습니다. pom.xml을 편집하여이 작업을 수행하는 방법을 알고 있지만이 동작은 기본적으로 나 자신을 위해서만 필요합니다 (따라서 pom.xml을 편집 할 수 없음). (그들이 거기에 내가 pom.xml 그들에게 보여 수정할 경우)pom.xml을 편집하지 않고 컴파일러 경고 표시

mvn -Dmaven.compiler.showWarnings=true -Dmaven.compiler.showDeprecation=true clean compile 

을하지만이 경고를 표시하지 않습니다

나는 시도했다.

두 표현식 (maven.compiler.showWarningsmaven.compiler.showDeprecation) exist.

무엇이 놓치나요?

+0

어떤 버전의 maven 및 maven 컴파일러 플러그인을 사용하고 있습니까? maven-3.0.3 및 maven 컴파일러 플러그인 2.3.2 – Raghuram

+0

@Raghuram : 2.2.1 및 3.0.3을 새로 설치하여 최소 프로젝트에서 다시 시도했습니다. 경고가 표시되지 않습니다 (지원 중단). – shellholic

답변

0

아마도 이것들을 Maven 프로파일에 랩핑 할 수 있으며 대신 -P로 프로파일을 지정할 수 있습니다.

그것은 같은 것을 (나는이 생각을 테스트하지 않았다) 것 :

<profiles> 
    <profile> 
     <id>development</id> 
     <build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <configuration> 
       <!-- compiler options go here --> 
      </configuration> 
     </plugin> 
     </build> 
    </profile> 
</profiles> 

을 그리고

mvn compile -Pdebug 
-1

이 시도로 실행합니다.

mvn clean install -Dmaven.compiler.showDeprecation=true -Dmaven.compiler.showWarnings=true > warnings.txt