Skip to content

Commit 7aa6570

Browse files
committed
[ISSUE 7] add build number + clean sonar-packaging-maven-plugin
1 parent 39996e7 commit 7aa6570

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
- [#5](https://github.com/green-code-initiative/ecoCode-python/pull/5) Upgrade licence system and licence headers of Java files
1515
- [#6](https://github.com/green-code-initiative/ecoCode-python/pull/6) Adding EC35 rule : EC35 rule replaces EC34 with a specific use case ("file not found" sepcific)
16+
- [#7](https://github.com/green-code-initiative/ecoCode-python/issues/7) Add build number to manifest
1617

1718
### Deleted
1819

pom.xml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@
5353
<!-- max version with SonarQube 10.0 : check lib/extension directory -->
5454
<sonarpython.version>4.1.0.11333</sonarpython.version>
5555

56-
<sonar-packaging.version>1.21.0.505</sonar-packaging.version>
56+
<sonar-packaging.version>1.23.0.740</sonar-packaging.version>
5757
<sonar.skipDependenciesPackaging>true</sonar.skipDependenciesPackaging>
5858

5959
<mockito.version>5.3.1</mockito.version>
6060

6161
<!-- temporary version waiting for real automatic release in ecocode repository -->
62-
<ecocode-rules-specifications.version>0.0.6</ecocode-rules-specifications.version>
62+
<ecocode-rules-specifications.version>0.0.7</ecocode-rules-specifications.version>
6363

6464
<sonar-analyzer-commons.version>2.5.0.1358</sonar-analyzer-commons.version>
6565

@@ -184,8 +184,13 @@
184184
<pluginName>${project.name}</pluginName>
185185
<pluginClass>fr.greencodeinitiative.python.PythonPlugin</pluginClass>
186186
<sonarLintSupported>true</sonarLintSupported>
187-
<sonarQubeMinVersion>${sonarqube.version}</sonarQubeMinVersion>
187+
<pluginApiMinVersion>${sonarqube.version}</pluginApiMinVersion>
188188
<jreMinVersion>${java.version}</jreMinVersion>
189+
<archive>
190+
<manifestEntries>
191+
<Implementation-Build>${buildNumber}</Implementation-Build>
192+
</manifestEntries>
193+
</archive>
189194
</configuration>
190195
</plugin>
191196
<!-- To keep because of dependency sonar-analyzer-commons -->
@@ -232,6 +237,24 @@
232237
</execution>
233238
</executions>
234239
</plugin>
240+
<plugin>
241+
<!-- plugin to generate a unique build number for sonar-packaging-maven-plugin : usage of buildNumber variable -->
242+
<groupId>org.codehaus.mojo</groupId>
243+
<artifactId>buildnumber-maven-plugin</artifactId>
244+
<version>3.1.0</version>
245+
<executions>
246+
<execution>
247+
<phase>validate</phase>
248+
<goals>
249+
<goal>create</goal>
250+
</goals>
251+
</execution>
252+
</executions>
253+
<configuration>
254+
<getRevisionOnlyOnce>true</getRevisionOnlyOnce>
255+
<revisionOnScmFailure>0</revisionOnScmFailure>
256+
</configuration>
257+
</plugin>
235258
<plugin>
236259
<groupId>com.mycila</groupId>
237260
<artifactId>license-maven-plugin</artifactId>

0 commit comments

Comments
 (0)