|
3 | 3 | <modelVersion>4.0.0</modelVersion> |
4 | 4 | <groupId>com.github.package-url</groupId> |
5 | 5 | <artifactId>packageurl-java</artifactId> |
6 | | - <version>1.5.1-SNAPSHOT</version> |
| 6 | + <version>1.6.0-SNAPSHOT</version> |
7 | 7 | <packaging>jar</packaging> |
8 | 8 |
|
9 | 9 | <name>Package URL</name> |
|
41 | 41 | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
42 | 42 | <maven.javadoc.failOnError>false</maven.javadoc.failOnError> |
43 | 43 |
|
| 44 | + <!-- |
| 45 | + ~ `project.build.outputTimestamp` is required to be present for reproducible builds |
| 46 | + ~ |
| 47 | + ~ Its value fixes various timestamps present in the JAR and should be incremented at each release. |
| 48 | + --> |
| 49 | + <project.build.outputTimestamp>2025-03-15T10:12:28Z</project.build.outputTimestamp> |
| 50 | + |
44 | 51 | <!-- Build requirements --> |
45 | 52 | <!-- |
46 | 53 | ~ Minimum JDK version required to build the library: |
|
55 | 62 | <max.jdk.version>18</max.jdk.version> |
56 | 63 |
|
57 | 64 | <!-- Maven Plugin Versions --> |
| 65 | + <bnd.maven.plugin.version>7.1.0</bnd.maven.plugin.version> |
| 66 | + <builder.helper.maven.plugin.version>3.6.0</builder.helper.maven.plugin.version> |
58 | 67 | <cyclonedx-maven-plugin.version>2.9.1</cyclonedx-maven-plugin.version> |
59 | 68 | <maven.clean.plugin.version>3.4.1</maven.clean.plugin.version> |
60 | 69 | <maven.compiler.plugin.version>3.14.0</maven.compiler.plugin.version> |
|
131 | 140 | <optional>true</optional> |
132 | 141 | <scope>provided</scope> |
133 | 142 | </dependency> |
| 143 | + <dependency> |
| 144 | + <groupId>org.osgi</groupId> |
| 145 | + <artifactId>org.osgi.annotation.bundle</artifactId> |
| 146 | + <version>2.0.0</version> |
| 147 | + <scope>provided</scope> |
| 148 | + </dependency> |
134 | 149 | <dependency> |
135 | 150 | <groupId>org.jspecify</groupId> |
136 | 151 | <artifactId>jspecify</artifactId> |
|
159 | 174 | <build> |
160 | 175 | <pluginManagement> |
161 | 176 | <plugins> |
| 177 | + <plugin> |
| 178 | + <groupId>biz.aQute.bnd</groupId> |
| 179 | + <artifactId>bnd-baseline-maven-plugin</artifactId> |
| 180 | + <version>${bnd.maven.plugin.version}</version> |
| 181 | + </plugin> |
| 182 | + <plugin> |
| 183 | + <groupId>biz.aQute.bnd</groupId> |
| 184 | + <artifactId>bnd-maven-plugin</artifactId> |
| 185 | + <version>${bnd.maven.plugin.version}</version> |
| 186 | + </plugin> |
162 | 187 | <plugin> |
163 | 188 | <groupId>org.apache.maven.plugins</groupId> |
164 | 189 | <artifactId>maven-clean-plugin</artifactId> |
|
217 | 242 | </plugins> |
218 | 243 | </pluginManagement> |
219 | 244 | <plugins> |
| 245 | + <!-- |
| 246 | + ~ Parses the version into components. |
| 247 | + ~ |
| 248 | + ~ The parsed version is used to generate the `Specification-Version` manifest header. |
| 249 | + --> |
| 250 | + <plugin> |
| 251 | + <groupId>org.codehaus.mojo</groupId> |
| 252 | + <artifactId>build-helper-maven-plugin</artifactId> |
| 253 | + <version>${builder.helper.maven.plugin.version}</version> |
| 254 | + <executions> |
| 255 | + <execution> |
| 256 | + <id>parse-version</id> |
| 257 | + <goals> |
| 258 | + <goal>parse-version</goal> |
| 259 | + </goals> |
| 260 | + <phase>validate</phase> |
| 261 | + </execution> |
| 262 | + </executions> |
| 263 | + </plugin> |
220 | 264 | <plugin> |
221 | 265 | <groupId>org.apache.maven.plugins</groupId> |
222 | 266 | <artifactId>maven-enforcer-plugin</artifactId> |
|
347 | 391 | </execution> |
348 | 392 | </executions> |
349 | 393 | </plugin> |
| 394 | + <!-- |
| 395 | + ~ Generates: |
| 396 | + ~ |
| 397 | + ~ - An OSGi manifest. |
| 398 | + ~ - A JPMS module descriptor. |
| 399 | + ~ - The JAR artifact, by replacing `maven-jar-plugin`. |
| 400 | + ~ |
| 401 | + ~ The advantage of the `jar` goal over `bnd-process` |
| 402 | + ~ is that it does not leave `module-info.class` files in the output directory, |
| 403 | + ~ which tend to confuse IDEs and need to be removed before a recompilation. |
| 404 | + ~ |
| 405 | + ~ If `ServiceLoader` services were to be added `bnd-process` must be used to generate the appropriate |
| 406 | + ~ `META-INF/services` files and equivalent OSGi and JPMS entries. |
| 407 | + --> |
| 408 | + <plugin> |
| 409 | + <groupId>biz.aQute.bnd</groupId> |
| 410 | + <artifactId>bnd-maven-plugin</artifactId> |
| 411 | + <!-- Replaces the `default-jar` execution of the Maven Jar Plugin --> |
| 412 | + <extensions>true</extensions> |
| 413 | + <executions> |
| 414 | + <execution> |
| 415 | + <id>generate-jar-and-module-descriptors</id> |
| 416 | + <goals> |
| 417 | + <goal>jar</goal> |
| 418 | + </goals> |
| 419 | + </execution> |
| 420 | + </executions> |
| 421 | + </plugin> |
| 422 | + <!-- |
| 423 | + ~ Checks for binary compatibility with the previous revision. |
| 424 | + ~ If this goal fails, the version of packages in `package-info.java` files must be incremented. |
| 425 | + ~ |
| 426 | + ~ - If the difference type is `MICRO`, follow BND suggestions. |
| 427 | + ~ - If the difference type is `MINOR`, bump the artifact version to the next minor version. |
| 428 | + ~ - If the difference type is `MAJOR`, revert the breaking changes or make a major release. |
| 429 | + --> |
| 430 | + <plugin> |
| 431 | + <groupId>biz.aQute.bnd</groupId> |
| 432 | + <artifactId>bnd-baseline-maven-plugin</artifactId> |
| 433 | + <executions> |
| 434 | + <execution> |
| 435 | + <id>check-api-compatibility</id> |
| 436 | + <goals> |
| 437 | + <goal>baseline</goal> |
| 438 | + </goals> |
| 439 | + </execution> |
| 440 | + </executions> |
| 441 | + </plugin> |
350 | 442 | <plugin> |
351 | 443 | <groupId>org.cyclonedx</groupId> |
352 | 444 | <artifactId>cyclonedx-maven-plugin</artifactId> |
|
0 commit comments