2016-12-28 11 views
0

를 지정 받는다는 pom.xml 빌드 세션yuicompressor - 받는다는 - 플러그인 설치 MVN에서 일하거나 다음 단계

<build> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <version>3.1</version> 
        <configuration> 
         <source>1.7</source> 
         <target>1.7</target> 
         <compilerArgument></compilerArgument> 
        </configuration> 
       </plugin> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-war-plugin</artifactId> 
        <configuration> 
         <warName>${project.artifactId}</warName> 
         <warSourceExcludes>**/*.js,**/*.css</warSourceExcludes> 
        </configuration> 
       </plugin> 
       <plugin> 
        <groupId>net.alchim31.maven</groupId> 
        <artifactId>yuicompressor-maven-plugin</artifactId> 
        <version>1.5.1</version> 
        <executions> 
         <execution> 
          <phase>prepare-package</phase> 
          <goals> 
           <goal>compress</goal> 
          </goals> 
         </execution> 
        </executions> 
        <configuration> 
         <encoding>UTF-8</encoding> 
         <jswarn>false</jswarn> 
         <nosuffix>true</nosuffix> 
         <linebreakpos>-1</linebreakpos> 
         <excludes> 
          <exclude>**/*.min.js</exclude> 
          <exclude>**/*.min.css</exclude> 
         </excludes> 
        </configuration> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
    </build> 

를 실행하지 않을 때 (지정 단계입니다)가 mvn install 또는 mvn pre-package없는 yuicompressor-maven- 플러그인 작업 로그.

$mvn install 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building gif-www 1.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gif-www --- 
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 0 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ gif-www --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ gif-www --- 
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] skip non existing resourceDirectory /home/ximing/work/gifmiao/gif-www/src/test/resources 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ gif-www --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ gif-www --- 
[INFO] No tests to run. 
[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ gif-www --- 
[INFO] Packaging webapp 
[INFO] Assembling webapp [gif-www] in [/home/ximing/work/gifmiao/gif-www/target/gif-www-1.0-SNAPSHOT] 
[INFO] Processing war project 
[INFO] Copying webapp resources [/home/ximing/work/gifmiao/gif-www/src/main/webapp] 
[INFO] Webapp assembled in [170 msecs] 
[INFO] Building war: /home/ximing/work/gifmiao/gif-www/target/gif-www.war 
[INFO] WEB-INF/web.xml already added, skipping 

하지만 yuicompressor 로그를 얻을 수 있습니다 mvn yuicompressor:compress를 사용하는 플러그인이 작동하고 있음을 보여줍니다.

그리고 나는 또한 css와 js를 war 파일에 패키지하는 법을 모르겠다. 왜냐하면 같은 파일 이름으로 HTML 템플릿에 포함 된 코드를 수정하고 싶지 않기 때문이다. 하루 종일 이걸로 일 해왔다. 누군가 나에게 단서를 주었다.

답변