2014-11-27 2 views
0

maven checkstyle plugin에서 configLocation 옵션을 무시하고 싶습니다. pom.xml 파일의 샘플 부분은 다음과 같습니다maven checkstyle plugin에서 configLocation을 재정의하는 방법은 무엇입니까?

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-checkstyle-plugin</artifactId> 
    <executions> 
     <execution> 
     <goals> 
      <goal>check</goal> 
     </goals> 
     </execution> 
    </executions> 
    <configuration> 
     <configLocation>blahblah/checkstyle/checkstyle.xml</configLocation> 
     <consoleOutput>true</consoleOutput> 
    </configuration> 
    <dependencies> 
     <dependency> 
     <groupId>com.example.blahblah</groupId> 
     <artifactId>checkstyle-config</artifactId> 
     <version>2.0.0-SNAPSHOT</version> 
     </dependency> 
    </dependencies> 
    <configuration> 
     <configLocation>checkstyle.config.xml</configLocation> 
     <suppressionsLocation>checkstyle.suppressions.xml</suppressionsLocation> 

     ... other configuration ... 

    </configuration> 
    </plugin> 

은 위에서 볼 수 있듯이, checkstyle-설정은 스타일 검사 및 규칙에 대한 설정 파일 사용에 대한 규칙을 포함하는 별도의 Maven 프로젝트입니다 blahblah/checkstyle/checkstyle .xml. 내가 blahblah/checkstyle/checkstyle.xml을 무시하고 현재 프로젝트에 저장되어 있고 checkstyle-config 프로젝트가 아닌 다른 .xml을 사용해야한다면 어떻게 할 수 있습니까?

답변

0

위의 플러그인 구성 부분을 복사하고 구성 위치를 무시함으로써 모듈의 플러그인 구성을 무시할 수 있습니다. 여기서 구성 태그를 실행 내에서 이동할 수 있으므로 해당 구성은 해당 실행에만 적용 할 수 있습니다. 아래 예 참조

<plugin> 
<groupId>org.apache.maven.plugins</groupId> 
<artifactId>maven-checkstyle-plugin</artifactId> 
<executions> 
    <execution> 
    <goals> 
     <goal>check</goal> 
    </goals> 
    <configuration> 
     <configLocation>blahblah/checkstyle/checkstyle.xml</configLocation> 
    </configuration> 
    </execution> 
</executions> 
관련 문제