java - Exclude some classes via Maven build -


i converting gradle based android project maven , have hit speed bump when comes including simplexml framework.

in gradle can specify following when importing library:

compile('org.simpleframework:simple-xml:2.7.+') {         exclude module: 'stax'         exclude module: 'stax-api'         exclude module: 'xpp3' 

how can in maven please? have tried using shade plugin think made mess of that. here attempt:

<plugin>             <groupid>org.apache.maven.plugins</groupid>             <artifactid>maven-shade-plugin</artifactid>             <version>2.4.1</version>             <executions>               <execution>                 <phase>package</phase>                 <goals>                   <goal>shade</goal>                 </goals>                 <configuration>                   <artifactset>                     <excludes>                       <exclude>stax</exclude>                       <exclude>stax-api</exclude>                       <exclude>xpp3</exclude>                     </excludes>                   </artifactset>                 </configuration>               </execution>             </executions>           </plugin> 

i think want described here: https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

basically, within <depdency> tag of library want exclude something, add <exclusions>. example link:

<dependencies> <dependency>   <groupid>sample.projecta</groupid>   <artifactid>project-a</artifactid>   <version>1.0</version>   <scope>compile</scope>   <exclusions>     <exclusion>  <!-- declare exclusion here -->       <groupid>sample.projectb</groupid>       <artifactid>project-b</artifactid>     </exclusion>   </exclusions>  </dependency> 


Comments