This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git


The following commit(s) were added to refs/heads/master by this push:
     new 6e645ef7c Fix JDK transport mr JAR sources (#1597)
6e645ef7c is described below

commit 6e645ef7c66ecd13147f5934492e17f089f7d1ee
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Mon Sep 22 16:12:58 2025 +0200

    Fix JDK transport mr JAR sources (#1597)
    
    In case of release, the `sources` JAR contained classes.
    
    Now, it contains the "notable" (jdk-11) sources, as Java 8 sources are 
really just a "placeholder" to politely say "we do not work on Java 8" (JDK 
HttpClient is not available).
    
    Fixes #1595
---
 .../maven-resolver-transport-jdk/pom.xml           | 72 +++++++++++++++++++---
 1 file changed, 62 insertions(+), 10 deletions(-)

diff --git 
a/maven-resolver-transport-jdk-parent/maven-resolver-transport-jdk/pom.xml 
b/maven-resolver-transport-jdk-parent/maven-resolver-transport-jdk/pom.xml
index c34f15f03..50a0dcddf 100644
--- a/maven-resolver-transport-jdk-parent/maven-resolver-transport-jdk/pom.xml
+++ b/maven-resolver-transport-jdk-parent/maven-resolver-transport-jdk/pom.xml
@@ -79,12 +79,6 @@
   </dependencies>
 
   <build>
-    <resources>
-      <resource>
-        <filtering>false</filtering>
-        <directory>${project.build.directory}/generated-resources</directory>
-      </resource>
-    </resources>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -110,10 +104,11 @@
             <goals>
               <goal>unpack-dependencies</goal>
             </goals>
-            <phase>generate-resources</phase>
+            <phase>prepare-package</phase>
             <configuration>
               
<includeArtifactIds>maven-resolver-transport-jdk-8</includeArtifactIds>
-              
<outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
+              <excludeClassifiers>sources</excludeClassifiers>
+              
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
               <excludes>META-INF/maven/**</excludes>
             </configuration>
           </execution>
@@ -122,10 +117,11 @@
             <goals>
               <goal>unpack-dependencies</goal>
             </goals>
-            <phase>generate-resources</phase>
+            <phase>prepare-package</phase>
             <configuration>
               
<includeArtifactIds>maven-resolver-transport-jdk-11</includeArtifactIds>
-              
<outputDirectory>${project.build.directory}/generated-resources/META-INF/versions/11</outputDirectory>
+              <excludeClassifiers>sources</excludeClassifiers>
+              
<outputDirectory>${project.build.outputDirectory}/META-INF/versions/11</outputDirectory>
               <includes>**/*.class</includes>
             </configuration>
           </execution>
@@ -133,4 +129,60 @@
       </plugin>
     </plugins>
   </build>
+
+  <profiles>
+    <profile>
+      <id>apache-release</id>
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.maven.resolver</groupId>
+          <artifactId>maven-resolver-transport-jdk-11</artifactId>
+          <version>${project.version}</version>
+          <classifier>sources</classifier>
+          <optional>true</optional>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>java11-sources</id>
+                <goals>
+                  <goal>unpack-dependencies</goal>
+                </goals>
+                <phase>prepare-package</phase>
+                <configuration>
+                  
<includeArtifactIds>maven-resolver-transport-jdk-11</includeArtifactIds>
+                  <includeClassifiers>sources</includeClassifiers>
+                  
<outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+                  <includes>**/*.java</includes>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>build-helper-maven-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>add-source</id>
+                <goals>
+                  <goal>add-source</goal>
+                </goals>
+                <phase>prepare-package</phase>
+                <configuration>
+                  <sources>
+                    
<source>${project.build.directory}/generated-sources</source>
+                  </sources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>

Reply via email to