Skip to content

Commit 4f81ec1

Browse files
authored
Merge pull request #802 from Vlatombe/flatten-repositories
2 parents e46655d + 2e44a99 commit 4f81ec1

File tree

7 files changed

+88
-0
lines changed

7 files changed

+88
-0
lines changed

pom.xml

+4
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,10 @@
13381338
<flattenMode>oss</flattenMode>
13391339
<outputDirectory>${project.build.directory}</outputDirectory>
13401340
<flattenedPomFilename>${project.artifactId}-${project.version}.pom</flattenedPomFilename>
1341+
<!-- TODO https://github.com/mojohaus/flatten-maven-plugin/issues/362 -->
1342+
<pomElements>
1343+
<repositories>flatten</repositories>
1344+
</pomElements>
13411345
</configuration>
13421346
</execution>
13431347
</executions>

src/it/cd-plugin/.mvn/extensions.xml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
2+
<extension>
3+
<groupId>io.jenkins.tools.incrementals</groupId>
4+
<artifactId>git-changelist-maven-extension</artifactId>
5+
<version>1.6</version>
6+
</extension>
7+
</extensions>

src/it/cd-plugin/.mvn/maven.config

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-Pconsume-incrementals
2+
-Pmight-produce-incrementals
3+
-Dchangelist.format=%d.v%s

src/it/cd-plugin/invoker.properties

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Same options as in https://github.com/jenkins-infra/jenkins-maven-cd-action/blob/master/run.sh (but hard-coding a sample changelist)
2+
invoker.goals=-Dstyle.color=always -Dset.changelist -Dchangelist=1234.deadbeef5678 -ntp -P-consume-incrementals -Pquick-build clean install

src/it/cd-plugin/pom.xml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>org.jenkins-ci.plugins</groupId>
6+
<artifactId>plugin</artifactId>
7+
<version>@project.version@</version>
8+
<relativePath />
9+
</parent>
10+
<groupId>org.jenkins-ci.plugins.its</groupId>
11+
<artifactId>cd-plugin</artifactId>
12+
<version>${changelist}</version>
13+
<packaging>hpi</packaging>
14+
<name>CD plugin</name>
15+
<description>CD description</description>
16+
<properties>
17+
<changelist>999999-SNAPSHOT</changelist>
18+
<spotless.check.skip>false</spotless.check.skip>
19+
</properties>
20+
<dependencyManagement>
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.jenkins-ci.plugins</groupId>
24+
<artifactId>structs</artifactId>
25+
<version>1.5</version>
26+
</dependency>
27+
</dependencies>
28+
</dependencyManagement>
29+
<dependencies>
30+
<dependency>
31+
<groupId>org.jenkins-ci.plugins</groupId>
32+
<artifactId>structs</artifactId>
33+
</dependency>
34+
</dependencies>
35+
<repositories>
36+
<repository>
37+
<id>repo.jenkins-ci.org</id>
38+
<url>https://repo.jenkins-ci.org/public/</url>
39+
</repository>
40+
</repositories>
41+
<pluginRepositories>
42+
<pluginRepository>
43+
<id>repo.jenkins-ci.org</id>
44+
<url>https://repo.jenkins-ci.org/public/</url>
45+
</pluginRepository>
46+
</pluginRepositories>
47+
</project>

src/it/cd-plugin/postbuild.groovy

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
assert new File(basedir, 'target/cd-plugin.hpi').file
2+
assert new File(basedir, 'target/cd-plugin.jar').file
3+
4+
File installed = new File(basedir, '../../local-repo/org/jenkins-ci/plugins/its/cd-plugin/1234.deadbeef5678/')
5+
assert new File(installed, 'cd-plugin-1234.deadbeef5678.hpi').file
6+
7+
def targetPom = new File(basedir, 'target/cd-plugin-1234.deadbeef5678.pom')
8+
assert targetPom.file
9+
10+
def installedPom = new File(installed, 'cd-plugin-1234.deadbeef5678.pom')
11+
assert installedPom.file
12+
13+
assert installedPom.text.contains("<name>")
14+
assert installedPom.text.contains("<description>")
15+
assert installedPom.text.contains("<dependencies>")
16+
assert installedPom.text.contains("<build>")
17+
assert installedPom.text.contains("<scm>")
18+
assert !installedPom.text.contains("<properties>")
19+
assert !installedPom.text.contains("<dependencyManagement>")
20+
assert !installedPom.text.contains("<repositories>")
21+
assert !installedPom.text.contains("<pluginRepositories>")
22+
23+
return true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?jelly escape-by-default='true'?>
2+
<div/>

0 commit comments

Comments
 (0)