random-maven / flatten-maven-plugin

Simplify maven project descriptor for artifact deployment
https://random-maven.github.io/flatten-maven-plugin/flatten-mojo.html
Other
9 stars 5 forks source link
flatten maven plugin

Flatten Maven Plugin

Project License Travis Status Appvey Status Lines of Code

Production Release Development Release
Install
Central Bintray

Similar plugins

Plugin features

Maven goals

Plugin demo

Compare results

Usage examples

Test projects

flatten:flatten - produce deployment pom.xml.flatten

mvn clean package -P flatten
        <profile>
            <id>flatten</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.carrotgarden.maven</groupId>
                        <artifactId>flatten-maven-plugin</artifactId>
                        <configuration>

                            <!-- Control dependency resolution. -->
                            <performDependencyResolve>true</performDependencyResolve>
                            <includeScope>runtime</includeScope>
                            <excludeTransitive>false</excludeTransitive>

                            <!-- Remove these pom.xml members. -->
                            <performRemoveMembers>true</performRemoveMembers>
                            <memberRemoveList>
                                <member>parent</member>
                                <member>properties</member>
                                <member>distributionManagement</member>
                                <member>dependencyManagement</member>
                                <member>repositories</member>
                                <member>pluginRepositories</member>
                                <member>build</member>
                                <member>profiles</member>
                                <member>reporting</member>
                            </memberRemoveList>

                            <!-- Change published artifact identity. -->
                            <performOverrideIdentity>true</performOverrideIdentity>
                            <overrideArtifactId>${project.artifactId}</overrideArtifactId>

                            <!-- Switch project from pom.xml to pom.xml.flatten. -->
                            <performSwitchPomXml>true</performSwitchPomXml>
                            <packagingSwitchList>
                                <packaging>jar</packaging>
                            </packagingSwitchList>

                        </configuration>
                        <executions>
                            <!-- Activate "flatten:flatten" during "prepare-package" -->
                            <execution>
                                <goals>
                                    <goal>flatten</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

Build yourself

cd /tmp
git clone git@github.com:random-maven/flatten-maven-plugin.git
cd flatten-maven-plugin
./mvnw.sh clean install -B -P skip-test