Skip to content

Commit

Permalink
Add integration test for CI friendly resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
lasselindqvist committed Sep 24, 2018
1 parent b56d7e2 commit 02f238f
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/it/projects/resolve-properties-ci/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.mavenOpts = -Drevision=1.2.3.4 -Drevision1=1.2.3.5 -Dsmall=small -Dsha1=abcdefg -Dchangelist=1,2,3,4
65 changes: 65 additions & 0 deletions src/it/projects/resolve-properties-ci/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<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>resolve-properties-ci</artifactId>
<version>${revision}</version>

<properties>
<depVersion>1.1</depVersion>
<utilVersion>3.2.1</utilVersion>
<revision.property>${revision}</revision.property>
<revision1.property>${revision1}</revision1.property>
<small.property>${small}</small.property>
<small1.property>${small1}</small1.property>
<changelist.property>${changelist}</changelist.property>
<sha1.property>${sha1}</sha1.property>
</properties>

<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
<version>${revision}</version>
<classifier>${small}</classifier>
</dependency>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
<version>1.2.3.1</version>
<classifier>${small1}</classifier>
</dependency>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
<version>revision</version>
<classifier>small2</classifier>
</dependency>
</dependencies>

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

<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profilerevision>${revision}</profilerevision>
<profilerevision1>${revision1}</profilerevision1>
</properties>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion src/it/projects/resolve-properties-ci/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ assert '${small1}' == flattenedProject.dependencies.dependency[1].classifier.tex
assert 'revision' == flattenedProject.dependencies.dependency[2].version.text()
assert 'small2' == flattenedProject.dependencies.dependency[2].classifier.text()

assert '${revision}' == flattenedProject.profiles.profile.properties.profilerevision.text()
assert '1.2.3.4' == flattenedProject.profiles.profile.properties.profilerevision.text()
assert '${revision1}' == flattenedProject.profiles.profile.properties.profilerevision1.text()

0 comments on commit 02f238f

Please sign in to comment.