Guy Hutchison
Guy Hutchison

Reputation: 145

Maven shade plugin doesn't execute

I'm trying to work through a simple example of creating an executable JAR using the shade plugin. I walked through the example here pretty much line-for-line, and on my machine it appears the shade plugin doesn't execute at all.

My POM code for shade is:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
        </configuration>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

After running 'mvn package' the created JAR doesn't include any of the project dependencies. From the debug trace it doesn't appear that the shade plugin is ever called. Is there some additional step required to get shade to do its magic?

Edit: Full code of example is at https://github.com/hutch31/maven-shade-example

Edit 2: Github repo now has corrected code

Upvotes: 0

Views: 858

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35795

Plugins in <pluginManagement> will not be executed.

For that, they need to be placed in <plugins>.

Upvotes: 3

Related Questions