Skip to content

Commit b7a9c2b

Browse files
committed
build: once for all fix for reproducible builds
- more stable solution around `argLine` without duplicating `sure-fire` configruration
1 parent 3e78418 commit b7a9c2b

File tree

2 files changed

+29
-27
lines changed

2 files changed

+29
-27
lines changed

modules/jooby-cli/pom.xml

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
<Module-Name>io.jooby.cli</Module-Name>
1616
<jline.version>3.30.6</jline.version>
1717
<picocli.version>4.7.7</picocli.version>
18-
<!-- No argLine, make reproducible builds happy -->
19-
<argLine/>
18+
<cli.dependencies>${project.build.outputDirectory}${file.separator}dependencies.properties</cli.dependencies>
2019
</properties>
2120

2221
<dependencies>
@@ -27,13 +26,11 @@
2726
<scope>provided</scope>
2827
</dependency>
2928

30-
<!-- https://mvnrepository.com/artifact/com.github.jknack/handlebars -->
3129
<dependency>
3230
<groupId>com.github.jknack</groupId>
3331
<artifactId>handlebars</artifactId>
3432
</dependency>
3533

36-
<!-- https://mvnrepository.com/artifact/info.picocli/picocli -->
3734
<dependency>
3835
<groupId>info.picocli</groupId>
3936
<artifactId>picocli</artifactId>
@@ -105,7 +102,34 @@
105102
</goals>
106103
<phase>generate-resources</phase>
107104
<configuration>
108-
<outputFile>${project.build.outputDirectory}${file.separator}dependencies.properties</outputFile>
105+
<outputFile>${cli.dependencies}</outputFile>
106+
</configuration>
107+
</execution>
108+
</executions>
109+
</plugin>
110+
<!-- Cleanup output from write-project-properties, required for reproducible builds (excludes argLine) -->
111+
<plugin>
112+
<groupId>org.apache.maven.plugins</groupId>
113+
<artifactId>maven-antrun-plugin</artifactId>
114+
<version>${maven-antrun-plugin.version}</version>
115+
<executions>
116+
<execution>
117+
<phase>generate-resources</phase>
118+
<goals>
119+
<goal>run</goal>
120+
</goals>
121+
<configuration>
122+
<target>
123+
<loadfile property="filtered.dependencies" srcFile="${cli.dependencies}">
124+
<filterchain>
125+
<linecontains>
126+
<contains value=".version"/>
127+
</linecontains>
128+
<sortfilter/>
129+
</filterchain>
130+
</loadfile>
131+
<echo message="# dependencies:${line.separator}${filtered.dependencies}" file="${cli.dependencies}" />
132+
</target>
109133
</configuration>
110134
</execution>
111135
</executions>
@@ -128,23 +152,6 @@
128152
<release>17</release>
129153
</configuration>
130154
</plugin>
131-
<!-- sure-fire -->
132-
<plugin>
133-
<groupId>org.apache.maven.plugins</groupId>
134-
<artifactId>maven-surefire-plugin</artifactId>
135-
<version>${maven-surefire-plugin.version}</version>
136-
<inherited>false</inherited>
137-
<configuration>
138-
<includes>
139-
<include>**/*Test.java</include>
140-
<include>**/*Tests.java</include>
141-
<include>**/*Feature.java</include>
142-
<include>**/*Issue*.java</include>
143-
</includes>
144-
<useModulePath>false</useModulePath>
145-
<argLine>-javaagent:${maven.m2.repo}${file.separator}${mockito.agent}</argLine>
146-
</configuration>
147-
</plugin>
148155
<plugin>
149156
<groupId>com.fizzed</groupId>
150157
<artifactId>stork-maven-plugin</artifactId>

pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,6 @@
214214
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
215215

216216
<pre-commit-hook>etc${file.separator}source${file.separator}formatter.sh</pre-commit-hook>
217-
218-
<sonar.projectKey>jooby-project_jooby</sonar.projectKey>
219-
<sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
220-
<sonar.organization>jooby-project</sonar.organization>
221-
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
222217
</properties>
223218

224219
<dependencyManagement>

0 commit comments

Comments
 (0)