Using the source:jar
goal, how do I configure it such that the target/generated-sources
folder is excluded from the archive? I've tried a number of different configurations, and can't get any of them to work.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<excludes>
<exclude>target/generated-sources</exclude>
</excludes>
</configuration>
</plugin>
I've tried various things in the exlude
tag such as target/generated-sources/**/*.java
, com/mycompany/**/*.java
and because I became so convinced it wasn't even looking at that, just tried *.java
and it seems nothing gets excluded.
This is Maven 3.0.5 and the source plugin 2.2.1. I'm running this from the Maven CLI. Below is the complete POM for those interested.
<?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>foo-service</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.8</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<packageName>com.example</packageName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<excludes>
<exclude>target/generated-sources</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>