Production Release | Development Release | |
---|---|---|
Similar plugins
Plugin features
- replaces published identity
- resolves dependency version ranges
- excludes dependencies based on scope
- optionally includes transitive dependencies
- removes
pom.xml
members based on xml tag names - switches project
pom.xml
with generatedpom.xml.flatten
Maven goals
Compare results
- original pom.xml
- generated pom.xml.flatten
Test projects
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>
cd /tmp
git clone [email protected]:random-maven/flatten-maven-plugin.git
cd flatten-maven-plugin
./mvnw.sh clean install -B -P skip-test