JackPGreen
JackPGreen

Reputation: 1139

Stop specific maven-jar-plugin executions from being installed/deployed

I have a Maven project that generates additional JARs via maven-jar-plugin that are used for test purposes:

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.me</groupId>
    <artifactId>my-artifact</artifactId>
    <packaging>jar</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>some-other-sources</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <configuration>
                            <testClassesDirectory>${project.build.directory}/some-other-sources</testClassesDirectory>
                            <outputDirectory>${project.build.directory}/some-other-sources</outputDirectory>
                            <classifier>some-other-sources</classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

The additional some-other-sources should not be installed to the local repository (or deployed to the remote).

Is there a way to specify that these maven-jar-plugin outputs should be generated and put in the target folder only?

Upvotes: 2

Views: 71

Answers (0)

Related Questions