2017-12-13 16 views
0

Javascript를 모호하게하지 않고 GWT 애플리케이션을 컴파일해야하지만 이전에는 GWT를 사용해 본 적이 없었습니다.자바 스크립트가 난독 화되지 않도록 GWT에 알려주는 플래그는 어디에 사용합니까?

약간의 연구 끝에 GWT에 자바가 난독 화되지 않도록하기 위해 -style 플래그 (http://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html#DevGuideCompilerOptions)에 대해 알게되었습니다.

우리 프로젝트에도 pom.xml 파일이 있습니다. 우리가 그렇게 보이는 가정 해 봅시다 :

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>com.example</groupId> 
    <artifactId>test</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>war</packaging> 

    <dependencyManagement> 
    <dependencies> 
     <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt</artifactId> 
     <version>2.7.0</version> 
     <type>pom</type> 
     <scope>import</scope> 
     </dependency> 
    </dependencies> 
    </dependencyManagement> 
    <dependencies> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-user</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-dev</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-codeserver</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-servlet</artifactId> 
     <scope>runtime</scope> 
    </dependency> 
    </dependencies> 

    <build> 
    <plugins> 
     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>gwt-maven-plugin</artifactId> 
     <version>2.7.0</version> 
     <executions> 
      <execution> 
      <goals> 
       <goal>compile</goal> 
      </goals> 
      </execution> 
     </executions> 
     <configuration> 
      <module>com.example.test.Test</module> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

이것이 내가이 -style 플래그를 넣어 가정하고있는 곳인가? 그렇다면 정확히 XML 트리에 어디에 넣어야합니까?

+0

설명서를 보면 해당 플래그가 명령 줄에 표시됩니다. – Archer

답변

1

당신은 구성을

<build> 
    <plugins> 
     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>gwt-maven-plugin</artifactId> 
     <version>2.7.0</version> 
     <executions> 
      <execution> 
       <configuration> 
        <style>${gwtcompiler.style}</style> 
       </configuration> 
      <goals> 
       <goal>compile</goal> 
      </goals> 
      </execution> 
     </executions> 
     <configuration> 
      <module>com.example.test.Test</module> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 

플러그인 컴파일 GWT의 깃발을 놓아야합니다 그리고 당신은 당신이 사용하고자하는 행의 주석을 해제, 당신의 치어에 앞서 변수를 정의합니다.

또는 프로필을 사용하여 명령 줄에서 설정하십시오.