1
만 압축 :Maven은, yuicompressor, 필터 및 받는다는 전쟁 - 플러그인 : 나는 pom.xml 파일 다음 한 PROD
<build>
<finalName>edrive</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*xml</include>
<include>**/*properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>prepare</id>
<phase>prepare-package</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
<execution>
<id>default-war</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
<configuration>
<warSourceDirectory>${project.build.directory}/${project.build.finalName}</warSourceDirectory>
</configuration>
</execution>
</executions>
<configuration>
<filters>
<filter>src/main/filters/filter.properties</filter>
</filters>
<filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
<webResources>
<resource>
<directory>${project.build.directory}/${project.build.finalName}/resources</directory>
<filtering>true</filtering>
<targetPath>resources</targetPath>
</resource>
</webResources>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
<archiveClasses>true</archiveClasses>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>prod</id>
<activation>
<property>
<name>prodEnabled</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<jswarn>false</jswarn>
<nosuffix>true</nosuffix>
<force>true</force>
<sourceDirectory>WebContent/resources</sourceDirectory>
<outputDirectory>${project.build.directory}/${project.build.finalName}/resources</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
나는 압축 오직 하나 개의 프로파일에 대한 자원을 갖고 싶어. 말, 나는
MVN 깨끗한
가 .WAR에 -DprodEnabled = 사실
예상 결과 압축해야 자원을 설치 실행합니다. 내가
MVN을 실행하면 청소는 그대로
다음 리소스가 .WAR에 보관해야합니다 설치합니다. 현재 문제는 두 경우 모두 대상 및 .war에서 필터링 할 때 출력을 제로 (war) 플러그인이 0으로 만듭니다. 그 문제를 해결하는 방법?