2016-04-26 8 views
0

Ich habe Abhängigkeit in meinem pom:Ausschließen Ressourcenpaket von Maven Abhängigkeit (webjars)

<dependency> 
    <groupId>org.webjars</groupId> 
    <artifactId>extjs</artifactId> 
    <version>6.0.0</version> 
</dependency> 

Nach meinem Projekt in dem Krieg bauen, habe ich eine Packung erhalten, die über 200 MB hat. Gibt es eine Möglichkeit Paket

/webjars/extjs/6.0.0/build/examples/ 

aus dieser Abhängigkeit auszuschließen? Wie kann ich das machen?

Ich habe versucht, Schatten-Plugin zu verwenden, aber es funktioniert nicht, auch in Config-Krieg-Plugin:

<configuration> 
    <packagingExcludes> 
     /webjars/extjs/${extjs.version}/build/examples/ 
    </packagingExcludes> 
</configuration> 

nicht funktioniert.

Antwort

0

Bitte werfen Sie einen Blick auf this Seite. Es geht darum, Webjar zu verkleinern, indem unnötige Inhalte ausgeschlossen werden.

0

Dank Dark Knight fand ich die Lösung, die für mich funktioniert:

<dependency> 
     <groupId>org.webjars</groupId> 
     <artifactId>extjs</artifactId> 
     <version>${extjs.version}</version> 
     <scope>provided</scope> 
    </dependency> 
... 

     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-war-plugin</artifactId> 
      <version>2.6</version> 
      <configuration> 
       <archive> 
        <manifest> 
         <addClasspath>true</addClasspath> 
         <addDefaultImplementationEntries>true</addDefaultImplementationEntries> 
         <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> 
        </manifest> 
       </archive> 
       <webResources> 
        <resource> 
         <directory>${project.build.directory}\extjs\META-INF\resources</directory> 
        </resource> 
       </webResources> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <executions> 
       <execution> 
        <id>unpack-jar</id> 
        <phase>generate-resources</phase> 
        <goals> 
         <goal>unpack</goal> 
        </goals> 
        <configuration> 
         <artifactItems> 
          <artifactItem> 
           <groupId>org.webjars</groupId> 
           <artifactId>extjs</artifactId> 
           <version>${extjs.version}</version> 
           <type>jar</type> 
           <destFileName>extjs-dependency</destFileName> 
           <includes> 
            META-INF/resources/webjars/extjs/${extjs.version}/build/*.*, 
            META-INF/resources/webjars/extjs/${extjs.version}/build/classic/**/*.*, 
            META-INF/resources/webjars/extjs/${extjs.version}/build/packages/**/*.* 
           </includes> 
           <outputDirectory> 
            ${project.build.directory}/extjs 
           </outputDirectory> 
          </artifactItem> 
         </artifactItems> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin>