Skip to content

Commit

Permalink
Merge branch 'BSI-Business-Systems-Integration-AG-issue14_missingProf…
Browse files Browse the repository at this point in the history
…iles'
  • Loading branch information
hohwille committed Oct 16, 2017
2 parents 617b8fc + e48d4f6 commit cd273c8
Show file tree
Hide file tree
Showing 14 changed files with 191 additions and 38 deletions.
25 changes: 25 additions & 0 deletions src/it/projects/os-profile-active-in-parent/parent/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<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>os-profile-active-in-parent_parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<profiles>
<profile>
<id>os</id>
<activation>
<os>
<family>!customOS</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
13 changes: 13 additions & 0 deletions src/it/projects/os-profile-active-in-parent/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<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>os-profile-active-in-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>

<parent>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>os-profile-active-in-parent_parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>parent</relativePath>
</parent>
</project>
33 changes: 33 additions & 0 deletions src/it/projects/os-profile-active-in-parent/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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 )
assert 0 == originalProject.dependencies.size()
assert 'os' == originalProject.profiles.profile.id.text()
assert 1 == originalProject.profiles.profile.dependencies.size()

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

def flattendProject = new XmlSlurper().parse( flattendPom )
assert 0 == flattendProject.dependencies.size()
assert 'os' == flattendProject.profiles.profile.id.text()
assert 1 == flattendProject.profiles.profile.dependencies.size()
8 changes: 4 additions & 4 deletions src/it/projects/os-profile-active/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<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>jdk-profile-active</artifactId>
<artifactId>os-profile-active</artifactId>
<version>0.0.1-SNAPSHOT</version>

<profiles>
<profile>
<id>os</id>
Expand All @@ -20,5 +20,5 @@
</dependency>
</dependencies>
</profile>
</profiles>
</project>
</profiles>
</project>
8 changes: 4 additions & 4 deletions src/it/projects/os-profile-inactive/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<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>jdk-profile-active</artifactId>
<artifactId>os-profile-active</artifactId>
<version>0.0.1-SNAPSHOT</version>

<profiles>
<profile>
<id>os</id>
Expand All @@ -20,5 +20,5 @@
</dependency>
</dependencies>
</profile>
</profiles>
</project>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>profile-with-dependencies-active-disabled</artifactId>
<version>0.0.1-SNAPSHOT</version>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<configuration>
<embedBuildProfileDependencies>true</embedBuildProfileDependencies>
</configuration>
Expand All @@ -30,5 +30,5 @@
</dependency>
</dependencies>
</profile>
</profiles>
</project>
</profiles>
</project>
8 changes: 4 additions & 4 deletions src/it/projects/profile-with-dependencies-active/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<configuration>
<embedBuildProfileDependencies>true</embedBuildProfileDependencies>
</configuration>
Expand All @@ -30,5 +30,5 @@
</dependency>
</dependencies>
</profile>
</profiles>
</project>
</profiles>
</project>
10 changes: 5 additions & 5 deletions src/it/projects/profile-with-dependencies-not-triggered/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<configuration>
<embedBuildProfileDependencies>true</embedBuildProfileDependencies>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>myprofile</id>
Expand All @@ -27,5 +27,5 @@
</dependency>
</dependencies>
</profile>
</profiles>
</project>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<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>profile-with-dependencies-triggered-by-folder-presence-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<configuration>
<embedBuildProfileDependencies>true</embedBuildProfileDependencies>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>myprofile</id>
<activation>
<file>
<exists>/tmp/</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<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>profile-with-dependencies-triggered-by-folder-presence</artifactId>
<version>0.0.1-SNAPSHOT</version>

<parent>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>profile-with-dependencies-triggered-by-folder-presence-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>parent</relativePath>
</parent>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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 )
assert 0 == originalProject.dependencies.size()
assert 'myprofile' == originalProject.profiles.profile.id.text()
assert 1 == originalProject.profiles.profile.dependencies.size()

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

def flattendProject = new XmlSlurper().parse( flattendPom )
assert 1 == flattendProject.dependencies.size()
assert 'dep' == flattendProject.dependencies.dependency.artifactId.text()
assert '1.1' == flattendProject.dependencies.dependency.version.text()
assert 0 == flattendProject.profiles.profile.size()
10 changes: 5 additions & 5 deletions src/it/projects/profile-with-dependencies-triggered/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<configuration>
<embedBuildProfileDependencies>true</embedBuildProfileDependencies>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>myprofile</id>
Expand All @@ -27,5 +27,5 @@
</dependency>
</dependencies>
</profile>
</profiles>
</project>
</profiles>
</project>
11 changes: 5 additions & 6 deletions src/it/projects/property-profile-active/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>property-profile-active</artifactId>
<version>0.0.1-SNAPSHOT</version>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<embedBuildProfileDependencies>true</embedBuildProfileDependencies>
</configuration>
</plugin>
</plugins>
</build>


<profiles>
<profile>
<id>property</id>
Expand All @@ -34,5 +33,5 @@
</dependency>
</dependencies>
</profile>
</profiles>
</project>
</profiles>
</project>
9 changes: 4 additions & 5 deletions src/it/projects/property-profile-inactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>property-profile-inactive</artifactId>
<version>0.0.1-SNAPSHOT</version>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<embedBuildProfileDependencies>true</embedBuildProfileDependencies>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>property</id>
Expand All @@ -33,5 +32,5 @@
</dependency>
</dependencies>
</profile>
</profiles>
</project>
</profiles>
</project>

0 comments on commit cd273c8

Please sign in to comment.