You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2022/03/21 15:36:58 UTC

[sling-slingfeature-maven-plugin] branch master updated: SLING-11219 : Previous artifact (toggle) is not used to generate api jars

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

cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-slingfeature-maven-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 0e6042a  SLING-11219 : Previous artifact (toggle) is not used to generate api jars
0e6042a is described below

commit 0e6042af040309a9227c7de3d0fb0de8280bc460
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 21 16:36:51 2022 +0100

    SLING-11219 : Previous artifact (toggle) is not used to generate api jars
---
 .../java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java   | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java b/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
index c7ea3e2..459b891 100644
--- a/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
+++ b/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
@@ -771,12 +771,12 @@ public class ApisJarMojo extends AbstractIncludingFeatureMojo {
             final ApisJarContext ctx,
             final RegionSupport regionSupport,
             Artifact artifact) throws MojoExecutionException {
-        final File bundleFile = getArtifactFile(artifact.getId());
+        File bundleFile = getArtifactFile(artifact.getId());
 
-        final Manifest manifest = regionSupport.getManifest(artifact.getId(), bundleFile);
+        Manifest manifest = regionSupport.getManifest(artifact.getId(), bundleFile);
 
         // check if the bundle is exporting packages?
-        final Clause[] exportedPackageClauses = regionSupport.getExportedPackages(manifest);
+        Clause[] exportedPackageClauses = regionSupport.getExportedPackages(manifest);
         if (exportedPackageClauses.length > 0) {
 
             // calculate the exported packages in the manifest file for all regions
@@ -810,6 +810,9 @@ public class ApisJarMojo extends AbstractIncludingFeatureMojo {
                     getLog().debug("Using " + previous.toMvnId() + " instead of " + artifact.getId().toMvnId()
                             + " due to disabled toggle(s)");
                     artifact = previousArtifact;
+                    bundleFile = getArtifactFile(artifact.getId());
+                    manifest = regionSupport.getManifest(artifact.getId(), bundleFile);
+                    exportedPackageClauses = regionSupport.getExportedPackages(manifest);
                 }
 
                 final ArtifactInfo info = ctx.addArtifactInfo(artifact);