Skip to content

Commit 4fa1c49

Browse files
committed
Merge remote-tracking branch 'upstream/master' into update-test-suite
2 parents 6a9912e + 1aafeae commit 4fa1c49

File tree

10 files changed

+729
-375
lines changed

10 files changed

+729
-375
lines changed

pom.xml

Lines changed: 94 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<modelVersion>4.0.0</modelVersion>
2525
<groupId>com.github.package-url</groupId>
2626
<artifactId>packageurl-java</artifactId>
27-
<version>1.6.0-SNAPSHOT</version>
27+
<version>2.0.0-SNAPSHOT</version>
2828
<packaging>jar</packaging>
2929

3030
<name>Package URL</name>
@@ -113,8 +113,10 @@
113113
<bnd.maven.plugin.version>7.1.0</bnd.maven.plugin.version>
114114
<builder.helper.maven.plugin.version>3.6.0</builder.helper.maven.plugin.version>
115115
<cyclonedx-maven-plugin.version>2.9.1</cyclonedx-maven-plugin.version>
116+
<exec.maven.plugin.version>3.5.0</exec.maven.plugin.version>
116117
<maven.clean.plugin.version>3.4.1</maven.clean.plugin.version>
117118
<maven.compiler.plugin.version>3.14.0</maven.compiler.plugin.version>
119+
<maven.dependency.plugin.version>3.8.1</maven.dependency.plugin.version>
118120
<maven.deploy.plugin.version>3.1.4</maven.deploy.plugin.version>
119121
<maven.enforcer.plugin.version>3.5.0</maven.enforcer.plugin.version>
120122
<maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
@@ -136,6 +138,7 @@
136138
<com.github.spotbugs.version>4.9.3</com.github.spotbugs.version>
137139
<!-- Dependency versions -->
138140
<jakarta.validation-api.version>3.1.1</jakarta.validation-api.version>
141+
<jmh.version>1.37</jmh.version>
139142
<json.version>20250107</json.version>
140143
<junit-bom.version>5.12.1</junit-bom.version>
141144
<maven-surefire-junit5-tree-reporter.version>1.4.0</maven-surefire-junit5-tree-reporter.version>
@@ -175,6 +178,12 @@
175178
<scope>provided</scope>
176179
<optional>true</optional>
177180
</dependency>
181+
<dependency>
182+
<groupId>org.openjdk.jmh</groupId>
183+
<artifactId>jmh-core</artifactId>
184+
<version>${jmh.version}</version>
185+
<scope>test</scope>
186+
</dependency>
178187
<dependency>
179188
<groupId>org.json</groupId>
180189
<artifactId>json</artifactId>
@@ -265,10 +274,10 @@
265274
</pluginManagement>
266275
<plugins>
267276
<!--
268-
~ Parses the version into components.
269-
~
270-
~ The parsed version is used to generate the `Specification-Version` manifest header.
271-
-->
277+
~ Parses the version into components.
278+
~
279+
~ The parsed version is used to generate the `Specification-Version` manifest header.
280+
-->
272281
<plugin>
273282
<groupId>org.codehaus.mojo</groupId>
274283
<artifactId>build-helper-maven-plugin</artifactId>
@@ -316,18 +325,18 @@
316325
<!-- Error Prone plugin -->
317326
<arg>-XDcompilePolicy=simple</arg>
318327
<arg>--should-stop=ifError=FLOW</arg>
319-
<arg>-Xplugin:ErrorProne</arg>
328+
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/generated-test-sources/.*</arg>
320329
<!--
321-
~ Due to a bug in IntelliJ IDEA, annotation processing MUST be enabled.
322-
~ Failing to do so will cause IDEA to ignore the annotation processor path
323-
~ and choke on the Error Prone compiler arguments.
324-
~
325-
~ On the other hand, we cannot pass an empty `annotationProcessors` list to Maven,
326-
~ since the `-processor` compiler argument requires at least one processor class name.
327-
~
328-
~ If you add an annotation processor, please also add an `annotationProcessors` configuration
329-
~ option.
330-
-->
330+
~ Due to a bug in IntelliJ IDEA, annotation processing MUST be enabled.
331+
~ Failing to do so will cause IDEA to ignore the annotation processor path
332+
~ and choke on the Error Prone compiler arguments.
333+
~
334+
~ On the other hand, we cannot pass an empty `annotationProcessors` list to Maven,
335+
~ since the `-processor` compiler argument requires at least one processor class name.
336+
~
337+
~ If you add an annotation processor, please also add an `annotationProcessors` configuration
338+
~ option.
339+
-->
331340
</compilerArgs>
332341
<annotationProcessorPaths>
333342
<path>
@@ -337,6 +346,26 @@
337346
</path>
338347
</annotationProcessorPaths>
339348
</configuration>
349+
<executions>
350+
<execution>
351+
<id>default-testCompile</id>
352+
<configuration>
353+
<compilerArgs combine.children="append">
354+
<arg>-proc:full</arg>
355+
</compilerArgs>
356+
<annotationProcessors>
357+
<processor>org.openjdk.jmh.generators.BenchmarkProcessor</processor>
358+
</annotationProcessors>
359+
<annotationProcessorPaths combine.children="append">
360+
<path>
361+
<groupId>org.openjdk.jmh</groupId>
362+
<artifactId>jmh-generator-annprocess</artifactId>
363+
<version>${jmh.version}</version>
364+
</path>
365+
</annotationProcessorPaths>
366+
</configuration>
367+
</execution>
368+
</executions>
340369
</plugin>
341370
<plugin>
342371
<groupId>com.diffplug.spotless</groupId>
@@ -602,5 +631,54 @@
602631
</plugins>
603632
</build>
604633
</profile>
634+
635+
<profile>
636+
<id>benchmark</id>
637+
<properties>
638+
<jmh.args>.*</jmh.args>
639+
<skipTests>true</skipTests>
640+
</properties>
641+
<build>
642+
<defaultGoal>test-compile
643+
dependency:build-classpath@build-classpath
644+
exec:exec@run-benchmark</defaultGoal>
645+
<plugins>
646+
<plugin>
647+
<groupId>org.apache.maven.plugins</groupId>
648+
<artifactId>maven-dependency-plugin</artifactId>
649+
<version>${maven.dependency.plugin.version}</version>
650+
<executions>
651+
<execution>
652+
<id>build-classpath</id>
653+
<goals>
654+
<goal>build-classpath</goal>
655+
</goals>
656+
<configuration>
657+
<includeScope>test</includeScope>
658+
<outputProperty>test.classpath</outputProperty>
659+
</configuration>
660+
</execution>
661+
</executions>
662+
</plugin>
663+
<plugin>
664+
<groupId>org.codehaus.mojo</groupId>
665+
<artifactId>exec-maven-plugin</artifactId>
666+
<version>${exec.maven.plugin.version}</version>
667+
<executions>
668+
<execution>
669+
<id>run-benchmark</id>
670+
<goals>
671+
<goal>exec</goal>
672+
</goals>
673+
<configuration>
674+
<executable>${java.home}/bin/java</executable>
675+
<commandlineArgs>-cp target/classes:target/test-classes:${test.classpath} org.openjdk.jmh.Main ${jmh.args}</commandlineArgs>
676+
</configuration>
677+
</execution>
678+
</executions>
679+
</plugin>
680+
</plugins>
681+
</build>
682+
</profile>
605683
</profiles>
606684
</project>

src/main/java/com/github/packageurl/MalformedPackageURLException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public MalformedPackageURLException(@Nullable String msg) {
5353
*
5454
* @param message the detail message
5555
* @param cause the cause
56-
* @since 1.6.0
56+
* @since 2.0.0
5757
*/
5858
public MalformedPackageURLException(String message, Throwable cause) {
5959
super(message, cause);
@@ -64,7 +64,7 @@ public MalformedPackageURLException(String message, Throwable cause) {
6464
* message of {@code (cause==null ? null : cause.toString())}.
6565
*
6666
* @param cause the cause
67-
* @since 1.6.0
67+
* @since 2.0.0
6868
*/
6969
public MalformedPackageURLException(Throwable cause) {
7070
super(cause);

0 commit comments

Comments
 (0)