2011-01-22 4 views
8

우리의 응용 프로그램은 profiles.xml 파일에 별도로 정의 된 다양한 활성 프로파일 (예 : A1, A2, A3, A5 ...)으로 구성됩니다. Maven 3은 모든 프로파일 정보가 pom.xml 파일 자체의 일부로 저장 될 것으로 기대합니다. 내가 명령 줄에서 그들을 지정 피할 수 있도록 내가하는 pom.xml 파일 내에서 활성 프로파일의 목록을 지정하는 방법을Maven3에서 활성 프로파일을 지정하는 방법

(예 MVN -PA1, A2, A3, A5)

답변

8

이해야 그것 :

<profiles> 
    <profile> 
    <id>profile-1</id> 
    <activation> 
     <activeByDefault>true</activeByDefault> 
    </activation> 
    ... 
    </profile> 
</profiles> 

here.

+0

여러 프로필에 대해 이것을 지정할 수 없지만 제안이 효과가 있다고 생각하지 않습니다. – user339108

4

@ javamonkey79의 대답에 추가적으로 settings.xml을 사용할 수 있습니다. 프로필과 활성화 부분이 있습니다. 다음 예제를보십시오 :

<profiles> 
    <profile> 
    <id>hudson-simulate</id> 
    <properties> 
    <gituser>username</gituser> 
    <gitpassword>secret</gitpassword> 
    </properties> 
    </profile> 
    <profile> 
    <id>other-profile</id> 
    <properties> 
    <proerty1>username</property1> 
    </properties> 
    </profile> 
</profiles> 

<activeProfiles> 
    <activeProfile>hudson-simulate</activeProfile> 
    <activeProfile>other-profile</activeProfile> 
</activeProfiles> 
관련 문제