2016-08-15 3 views
0

checkstyle check goal을 사용할 수 없었습니다. 내가 명령 mvn checkstyle:check을 사용할 때Maven checkstyle plugin - 목표를 확인해도 구성 파일을 찾을 수 없습니다.

Unable to find configuration file at location: ${project.parent.basedir}/.settings/my_checks.xml: Could not find resource '${project.parent.basedir}/.settings/my_checks.xml'.

나는이 오류가,하지만 난 mvn checkstyle:checkstyle를 실행하면이 구성 파일이 발견되고 예상대로 사용 : 나는 다음과 같은 오류를 받고 있어요.

플러그인 구성은 다음과 같습니다.

 <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-checkstyle-plugin</artifactId> 
      <version>2.17</version> 
      <executions> 
       <execution> 
        <goals> 
         <goal>check</goal> 
        </goals> 
        <phase>test</phase> 
       </execution> 
      </executions>   
     </plugin> 

... 

    <properties> 
     <checkstyle.config.location>${project.parent.basedir}/.settings/my_checks.xml</checkstyle.config.location>   
    </properties> 

의견이 있으십니까? checkstyle 목표는 왜 작동하지만 check 목표가 아닌가?

편집 : 추가 검토를 통해 $ {project.parent.basedir}이 (가) 확인 목표를 실행할 때 해결되지 않는다는 것을 알게되었습니다. checkstyle 목표를 호출 할 때 해결됩니다. 여전히 제안/해결 방법을 찾고 ...

답변

0

해결 방법은 $ {project.parent.basedir} 변수를 사용하지 않고 상대 경로를 사용하는 것입니다. 모든 모듈이 병렬 디렉토리이기 때문에 제 경우에는 작동합니다.

<checkstyle.config.location>../parent/.settings/my_checks.xml</checkstyle.config.location> 
관련 문제