You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Eric Norman (Jira)" <ji...@apache.org> on 2021/03/03 19:05:00 UTC

[jira] [Created] (SLING-10182) Analyze fails to evaluate when the aggregate feature contains the bundle being built

Eric Norman created SLING-10182:
-----------------------------------

             Summary: Analyze fails to evaluate when the aggregate feature contains the bundle being built
                 Key: SLING-10182
                 URL: https://issues.apache.org/jira/browse/SLING-10182
             Project: Sling
          Issue Type: Bug
            Reporter: Eric Norman
            Assignee: Eric Norman
             Fix For: Feature Model Analyser 1.3.24


BundleDescriptorImpl fails to load the manifest if the URL for the bundle points at a folder as it assumes the URL passed in points at a jar file.

I noticed this while trying to add an it-testing aggregate feature so a bundle could test itself in an integration test.  In this scenario, the URL for the local bundle gets passed to the BundleDescriptorImpl as a file URL pointing at the target/classes folder and fails the analyze-feature goal with this error:
{noformat}
Caused by: java.io.FileNotFoundException: /home/projects/sling-org-apache-sling-jcr-maintenance/target/classes (Is a directory)
    at java.io.RandomAccessFile.open0 (Native Method)
    at java.io.RandomAccessFile.open (RandomAccessFile.java:345)
    at java.io.RandomAccessFile.<init> (RandomAccessFile.java:259)
    at java.io.RandomAccessFile.<init> (RandomAccessFile.java:214)
    at java.util.zip.ZipFile$Source.<init> (ZipFile.java:1285)
    at java.util.zip.ZipFile$Source.get (ZipFile.java:1251)
    at java.util.zip.ZipFile$CleanableResource.<init> (ZipFile.java:732)
    at java.util.zip.ZipFile$CleanableResource.get (ZipFile.java:849)
    at java.util.zip.ZipFile.<init> (ZipFile.java:247)
    at java.util.zip.ZipFile.<init> (ZipFile.java:177)
    at java.util.jar.JarFile.<init> (JarFile.java:348)
    at java.util.jar.JarFile.<init> (JarFile.java:319)
    at java.util.jar.JarFile.<init> (JarFile.java:285)
    at org.apache.sling.feature.io.IOUtils.getJarFileFromURL (IOUtils.java:242)
    at org.apache.sling.feature.scanner.impl.BundleDescriptorImpl.getManifest (BundleDescriptorImpl.java:75)
    at org.apache.sling.feature.scanner.impl.BundleDescriptorImpl.<init> (BundleDescriptorImpl.java:83)
    at org.apache.sling.feature.scanner.Scanner.doScan (Scanner.java:146)
    at org.apache.sling.feature.scanner.Scanner.scanBundle (Scanner.java:117)
    at org.apache.sling.feature.scanner.Scanner.getBundleInfos (Scanner.java:162)
    at org.apache.sling.feature.scanner.Scanner.scan (Scanner.java:227)
    at org.apache.sling.feature.analyser.Analyser.analyse (Analyser.java:188)
    at org.apache.sling.feature.maven.mojos.AnalyseFeaturesMojo.execute (AnalyseFeaturesMojo.java:157)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
{noformat}
Expected that the BundleDescriptorImpl should check if the address is a file url pointing at a local directory and try to load the META-INF/MANIFEST.MF relative as a file within that directory.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)