Maven 프로젝트 빌드를 실행하는 현재 활성 프로파일을 인쇄하려고합니다.Maven : 현재 프로필을 콘솔에 인쇄하는 방법?
현재 프로필을 참조하는 속성과 함께 콘솔에 메시지를 인쇄하기 위해 maven-antrun-plugin
을 사용하고 있습니다.
${project.activeProfiles[0].id}
${project.profiles[0].id}
을하지만 두 경우 모두에서 변수를 해결하지 않고, 기록 된대로 "문자열을"인쇄 :
나는 다음과 같은 속성을 시도했다.
이 내 테스트입니다 :
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>current active profile: ${project.activeProfiles[0].id}</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
그러나 이것은 내가 얻는 결과 :
main:
[echo] current active profile: ${project.activeProfiles[0].id}
어떤 제안을 이해할 수있을 것이다.
감사합니다.
같은 것을 사용하는 이유는 프로필에 따라 달라, 특별히 할 하시겠습니까? – Tunaki