2014-06-11 7 views
0

WEB-INF 디렉토리가 .war 패키지에 포함되지 않도록하려면 어떻게해야합니까?maven 생성 전쟁에서 WEB-INF 제외

이것은 작동하지 않습니다.

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-war-plugin</artifactId> 
    <version>2.1</version> 
    <configuration> 
     <warSourceExcludes>WEB-INF/**</warSourceExcludes> 
    </configuration> 
</plugin> 

이것은 작동하지 않습니다.

 <warSourceExcludes>WEB-INF</warSourceExcludes> 

답변

0

단지의 .js, .CSS와 정적 HTML 사이트 이래로, 그리고 .html, 나는 META-INF 만 생성하는 rar 패키지 형식으로 전환했습니다. 그럼 내가 이것을 더했다 :

<project> 
    ... 
    <build> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-war-plugin</artifactId> 
     <version>2.3</version> 
     <configuration> 
      <archive> 
      <addMavenDescriptor>false</addMavenDescriptor> 
      </archive> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 
    ... 
</project> 
0

내가 그 WEB-INF는 소스 디렉토리의 한 부분이 아니라 자원로 간주됩니다 말을 경사 것이다. 따라서

당신이 재산 대신 webResource으로 시도해야합니다 :

https://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html

뭔가 같은 :

 <configuration> 
      <webResources> 
      <resource> 
       <!-- this is relative to the pom.xml directory --> 
       <directory>resource2</directory> 
       <!-- the list has a default value of ** --> 
       <excludes> 
       <exclude>WEB-INF</exclude> 
       </excludes> 
      </resource> 
      </webResources> 
     </configuration> 
+0

이것은 트릭을하는 것처럼 보이지 않았다. – user3731460