Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<contributor>
<name>Flabo</name>
</contributor>
<contributor>
<name>Kemal Soysal</name>
</contributor>
<contributor>
<name>Ralf Lübeck</name>
</contributor>
</contributors>

<prerequisites>
Expand Down Expand Up @@ -227,9 +233,21 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.inject</artifactId>
<version>0.3.5</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>


<reporting>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<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>org.codehaus.mojo.flatten.its</groupId>
<artifactId>multimodule-module-with-parent-direct-dependencies</artifactId>
<version>${revision}</version>

<parent>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>complete-multimodule-parent-pom-direct-dependencies</artifactId>
<version>${revision}</version>
</parent>

<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>childdep</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>childdep</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</dependencyManagement>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<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>org.codehaus.mojo.flatten.its</groupId>
<artifactId>multimodule-module-direct-dependencies</artifactId>
<version>${revision}</version>

<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<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">
<!-- required -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>complete-multimodule-parent-pom-direct-dependencies</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>

<!-- banned -->
<build>
<defaultGoal>verify</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

<ciManagement>
<url>http://localhost</url>
</ciManagement>

<contributors>
<contributor>
<name>Robert Scholte</name>
</contributor>
</contributors>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>parentdep</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>parentdep</artifactId>
</dependency>
</dependencies>

<description>This project contains only required, pom specific and ignorable elements</description>

<developers>
<developer>
<id>hohwille</id>
<name>J&#246;rg Hohwiller</name>
</developer>
</developers>

<distributionManagement>
<downloadUrl>http://mojo.codehaus.org/downloads</downloadUrl>
</distributionManagement>

<inceptionYear>2014</inceptionYear>

<issueManagement>
<system>jira</system>
<url>http://jira.codehaus.org/browse/MOJO</url>
</issueManagement>

<mailingLists>
<mailingList>
<name>announce</name>
</mailingList>
</mailingLists>

<modules>
<module>module</module>
<module>module-with-parent</module>
</modules>

<name>Complete POM</name>
<organization>
<name>Codehaus</name>
</organization>

<parent>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>parent-depMngt</artifactId>
<version>2</version>
</parent>

<pluginRepositories>
<pluginRepository>
<id>none</id>
<url>@repository.proxy.url@</url>
</pluginRepository>
</pluginRepositories>

<!-- this one is only required for maven-plugin packaging type -->
<prerequisites>
<maven>3.0</maven>
</prerequisites>

<properties>
<!-- Default revision -->
<revision>1.2.3.5</revision>

<key>value</key>
</properties>

<reporting>
<outputDirectory>target/site</outputDirectory>
</reporting>

<reports />

<scm>
<url>http://svn.codehaus.org/mojo</url>
</scm>

<url>http://mojo.codehaus.org</url>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
File originalPom = new File( basedir, 'pom.xml' )
assert originalPom.exists()

def originalProject = new XmlSlurper().parse( originalPom )
// required and maven-plugin specific elements
assert '4.0.0' == originalProject.modelVersion.text()
assert 'org.codehaus.mojo.flatten.its' == originalProject.groupId.text()
assert 'complete-multimodule-parent-pom-direct-dependencies' == originalProject.artifactId.text()
assert '${revision}' == originalProject.version.text()
assert 'pom' == originalProject.packaging.text()
// banned elements for artifact
assert 1 == originalProject.build.size()
assert 1 == originalProject.ciManagement.size()
assert 1 == originalProject.contributors.size()
assert 1 == originalProject.dependencyManagement.size()
assert 1 == originalProject.description.size()
assert 1 == originalProject.developers.size()
assert 1 == originalProject.distributionManagement.size()
assert 1 == originalProject.issueManagement.size()
assert 1 == originalProject.mailingLists.size()
assert 1 == originalProject.modules.size()
assert 1 == originalProject.name.size()
assert 1 == originalProject.organization.size()
assert 1 == originalProject.parent.size()
assert 1 == originalProject.pluginRepositories.size()
assert 1 == originalProject.prerequisites.size()
assert 1 == originalProject.properties.size()
assert 1 == originalProject.reporting.size()
assert 1 == originalProject.reports.size()
assert 1 == originalProject.scm.size()
assert 1 == originalProject.url.size()

// Parent module
File flattendPom = new File( basedir, '.flattened-pom.xml' )
assert flattendPom.exists()

def flattendProject = new XmlSlurper().parse( flattendPom )
// required elements
assert '4.0.0' == flattendProject.modelVersion.text()
assert 'org.codehaus.mojo.flatten.its' == flattendProject.groupId.text()
assert 'complete-multimodule-parent-pom-direct-dependencies' == flattendProject.artifactId.text()
assert '1.2.3.4' == flattendProject.version.text()
assert 'pom' == originalProject.packaging.text()

// Child module: module
File flattendChildPom = new File( basedir, 'module/.flattened-pom.xml' )
assert flattendChildPom.exists()

def flattendChildProject = new XmlSlurper().parse( flattendChildPom )
// required elements
assert '4.0.0' == flattendChildProject.modelVersion.text()
assert 'org.codehaus.mojo.flatten.its' == flattendChildProject.groupId.text()
assert 'multimodule-module-direct-dependencies' == flattendChildProject.artifactId.text()
assert '1.2.3.4' == flattendChildProject.version.text()
assert '1.2.3.4' == flattendChildProject.dependencies.dependency[0].version.text()

// Child module: module-with-parent
File flattendChildWithParentPom = new File( basedir, 'module-with-parent/.flattened-pom.xml' )
assert flattendChildWithParentPom.exists()

def flattendChildWithParentProject = new XmlSlurper().parse( flattendChildWithParentPom )
// required elements
assert '4.0.0' == flattendChildWithParentProject.modelVersion.text()
assert 'org.codehaus.mojo.flatten.its' == flattendChildWithParentProject.groupId.text()
assert 'multimodule-module-with-parent-direct-dependencies' == flattendChildWithParentProject.artifactId.text()
assert '1.2.3.4' == flattendChildWithParentProject.version.text()
assert '' == flattendChildWithParentProject.parent.text()
assert '' == flattendChildWithParentProject.dependencyManagement.text()
assert '1.2.3.4' == flattendChildWithParentProject.dependencies.dependency[0].version.text()
assert '' == flattendChildWithParentProject.dependencies.dependency[1].text()
13 changes: 12 additions & 1 deletion src/it/projects/inherit-parent-dependency/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,16 @@
</parent>
<artifactId>resolve-properties</artifactId>
<version>0.0.1-SNAPSHOT</version>

<build>
<defaultGoal>verify</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<configuration>
<flattenDependencyMode>all</flattenDependencyMode>
</configuration>
</plugin>
</plugins>
</build>
</project>
17 changes: 14 additions & 3 deletions src/it/projects/parent-with-version-range/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@
<version>[0,2]</version>
</parent>

<artifactId>parent-with-version-range</artifactId>
<version>0.0.1-SNAPSHOT</version>

<artifactId>parent-with-version-range</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<defaultGoal>verify</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<configuration>
<flattenDependencyMode>all</flattenDependencyMode>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading