Skip to content

Commit

Permalink
Merge pull request #802 from Vlatombe/flatten-repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlatombe authored Jul 6, 2023
2 parents e46655d + 2e44a99 commit 4f81ec1
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,10 @@
<flattenMode>oss</flattenMode>
<outputDirectory>${project.build.directory}</outputDirectory>
<flattenedPomFilename>${project.artifactId}-${project.version}.pom</flattenedPomFilename>
<!-- TODO https://github.com/mojohaus/flatten-maven-plugin/issues/362 -->
<pomElements>
<repositories>flatten</repositories>
</pomElements>
</configuration>
</execution>
</executions>
Expand Down
7 changes: 7 additions & 0 deletions src/it/cd-plugin/.mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<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">
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.6</version>
</extension>
</extensions>
3 changes: 3 additions & 0 deletions src/it/cd-plugin/.mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
-Dchangelist.format=%d.v%s
2 changes: 2 additions & 0 deletions src/it/cd-plugin/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Same options as in https://github.com/jenkins-infra/jenkins-maven-cd-action/blob/master/run.sh (but hard-coding a sample changelist)
invoker.goals=-Dstyle.color=always -Dset.changelist -Dchangelist=1234.deadbeef5678 -ntp -P-consume-incrementals -Pquick-build clean install
47 changes: 47 additions & 0 deletions src/it/cd-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>@project.version@</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.its</groupId>
<artifactId>cd-plugin</artifactId>
<version>${changelist}</version>
<packaging>hpi</packaging>
<name>CD plugin</name>
<description>CD description</description>
<properties>
<changelist>999999-SNAPSHOT</changelist>
<spotless.check.skip>false</spotless.check.skip>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
<version>1.5</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>
23 changes: 23 additions & 0 deletions src/it/cd-plugin/postbuild.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
assert new File(basedir, 'target/cd-plugin.hpi').file
assert new File(basedir, 'target/cd-plugin.jar').file

File installed = new File(basedir, '../../local-repo/org/jenkins-ci/plugins/its/cd-plugin/1234.deadbeef5678/')
assert new File(installed, 'cd-plugin-1234.deadbeef5678.hpi').file

def targetPom = new File(basedir, 'target/cd-plugin-1234.deadbeef5678.pom')
assert targetPom.file

def installedPom = new File(installed, 'cd-plugin-1234.deadbeef5678.pom')
assert installedPom.file

assert installedPom.text.contains("<name>")
assert installedPom.text.contains("<description>")
assert installedPom.text.contains("<dependencies>")
assert installedPom.text.contains("<build>")
assert installedPom.text.contains("<scm>")
assert !installedPom.text.contains("<properties>")
assert !installedPom.text.contains("<dependencyManagement>")
assert !installedPom.text.contains("<repositories>")
assert !installedPom.text.contains("<pluginRepositories>")

return true
2 changes: 2 additions & 0 deletions src/it/cd-plugin/src/main/resources/index.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?jelly escape-by-default='true'?>
<div/>

0 comments on commit 4f81ec1

Please sign in to comment.