Program Club

Maven의 기본 빌드 프로필

proclub 2020. 12. 29. 07:31
반응형

Maven의 기본 빌드 프로필


내 Maven 프로젝트에 프로파일 링을 추가했습니다.

        <profile>
            <id>da</id>                
        </profile>
        <profile>
            <id>live</id>
        </profile>
        <profile>
            <id>dev</id>
        </profile>

mvn clean install빌드 프로필을 지정하지 않고 명령 내릴 때 . 기본적으로 빌드 할 dev 프로필이 필요합니다 .

이것을 어떻게 달성 할 수 있습니까?


속성 activeByDefault사용하면 -P 매개 변수로 다른 프로파일을 선택하지 않은 경우 Maven에서 기본 프로파일을 선택할 수 있습니다.

<profiles>
    <profile>
        <id>da</id>                
    </profile>
    <profile>
        <id>live</id>
    </profile>
    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
    </profile>
<profiles>

Maven Introduction to Profiles 문서를 참조하세요.


다음을 실행하여 특정 프로필을 활성화 할 수도 있습니다.

mvn clean install -Pprod or 
mvn clean install -Pdev

참조 URL : https://stackoverflow.com/questions/11824328/default-build-profile-for-maven

반응형