Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyse fails with: Content Package Converter Exception Entry is outside of the target directory #175

Closed
stefanseifert opened this issue Aug 25, 2022 · 5 comments · Fixed by #181

Comments

@stefanseifert
Copy link
Contributor

since release 1.4.18 our maven builds fails in the analyse setup with this exception. it worked fine with 1.4.16 and below.

[ERROR] Failed to execute goal com.adobe.aem:aemanalyser-maven-plugin:1.4.18:project-analyse (aem-analyser) on project mycompany.myprojectgroup.myproject1.config-definition: Content Package Converter Exception Entry is outside of the target directory -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.adobe.aem:aemanalyser-maven-plugin:1.4.18:project-analyse (aem-analyser) on project mycompany.myprojectgroup.myproject1.config-definition: Content Package Converter Exception Entry is outside of the target directory
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    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)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Content Package Converter Exception Entry is outside of the target directory
    at com.adobe.aem.analyser.mojos.AemAnalyseMojo.convertContentPackages (AemAnalyseMojo.java:294)
    at com.adobe.aem.analyser.mojos.AemAnalyseMojo.execute (AemAnalyseMojo.java:259)
    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)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.io.IOException: Entry is outside of the target directory
    at org.apache.sling.feature.cpconverter.handlers.slinginitialcontent.SlingInitialContentBundleEntryMetaDataCollector.extractFile (SlingInitialContentBundleEntryMetaDataCollector.java:128)
    at org.apache.sling.feature.cpconverter.handlers.slinginitialcontent.SlingInitialContentBundleEntryMetaDataCollector.collectFromContextAndWriteTmpFiles (SlingInitialContentBundleEntryMetaDataCollector.java:103)
    at org.apache.sling.feature.cpconverter.handlers.slinginitialcontent.BundleSlingInitialContentExtractor.extract (BundleSlingInitialContentExtractor.java:80)
    at org.apache.sling.feature.cpconverter.handlers.SlingInitialContentBundleHandler.processBundleInputStream (SlingInitialContentBundleHandler.java:53)
    at org.apache.sling.feature.cpconverter.handlers.BundleEntryHandler.handle (BundleEntryHandler.java:141)
    at org.apache.sling.feature.cpconverter.vltpkg.RecollectorVaultPackageScanner.onFile (RecollectorVaultPackageScanner.java:61)
    at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse (BaseVaultPackageScanner.java:112)
    at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse (BaseVaultPackageScanner.java:104)
    at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse (BaseVaultPackageScanner.java:104)
    at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse (BaseVaultPackageScanner.java:104)
    at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse (BaseVaultPackageScanner.java:104)
    at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse (BaseVaultPackageScanner.java:104)
    at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse (BaseVaultPackageScanner.java:104)
    at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse (BaseVaultPackageScanner.java:91)
    at org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter.firstPass (ContentPackage2FeatureModelConverter.java:288)
    at org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter.convert (ContentPackage2FeatureModelConverter.java:267)
    at com.adobe.aem.analyser.AemPackageConverter.convert (AemPackageConverter.java:180)
    at com.adobe.aem.analyser.mojos.AemAnalyseMojo.convertContentPackages (AemAnalyseMojo.java:289)
    at com.adobe.aem.analyser.mojos.AemAnalyseMojo.execute (AemAnalyseMojo.java:259)
    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)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

the content package that is validated is inside the target directory.

steps to reproduce the problem:

  1. create a new AEM project using this archetype:

mvn org.apache.maven.plugins:maven-archetype-plugin:3.1.0:generate -DinteractiveMode=false \
  -DarchetypeGroupId=io.wcm.maven.archetypes \
  -DarchetypeArtifactId=io.wcm.maven.archetypes.aem \
  -DarchetypeVersion=3.6.4 \
  -DprojectName=myproject1 \
  -DgroupId=mycompany.myprojectgroup \
  -DartifactId=mycompany.myprojectgroup.myproject1 \
  -Dversion=1.0.0-SNAPSHOT \
  -Dpackage=mycompany.myprojectgroup.myproject1 \
  -DpackageGroupName=mycompany \
  -DaemAuthorPort=4502 \
  -DaemPublishPort=4503 \
  -DoptionJavaVersion=11 \
  -DoptionAemVersion=cloud \
  -DoptionAemServicePack=n \
  -DoptionAemServicePackAPI=n \
  -DoptionSlingInitialContentBundle=n \
  -DoptionEditableTemplates=y \
  -DoptionMultiBundleLayout=n \
  -DoptionContextAwareConfig=y \
  -DoptionWcmioHandler=n \
  -DoptionSlingModelsLatest=n \
  -DoptionContextAwareConfigLatest=n \
  -DoptionAcsCommons=n \
  -DoptionFrontend=n \
  -DoptionNodeJsPlugin=n \
  -DoptionIntegrationTests=n
  1. in config-definition/pom.xml add <version>1.4.18</version> to the definition of aemanalyser-maven-plugin
  2. build the project with mvn clean install
@stefanseifert stefanseifert changed the title Analyze fails with: Content Package Converter Exception Entry is outside of the target directory Analyse fails with: Content Package Converter Exception Entry is outside of the target directory Aug 25, 2022
stefanseifert added a commit to wcm-io/io.wcm.maven.aem-global-parent that referenced this issue Aug 25, 2022
@cziegeler
Copy link
Contributor

@stefanseifert I just tried to reproduce this, and it works for me

@stefanseifert
Copy link
Contributor Author

@cziegeler i tested it again - problem is still present also in 1.4.20.

testing on different environments i discovered it only fails on windows environment. can you retest on windows?
maybe it's another slash-backslash-problem.

@cziegeler
Copy link
Contributor

@stefanseifert Thanks, I'll give it a try on windows

@cziegeler
Copy link
Contributor

Indeed, it fails on windows, due to a bug in Apache Sling's content package to feature model converter: https://issues.apache.org/jira/browse/SLING-11615

@stefanseifert
Copy link
Contributor Author

great - thanks for finding (and fixing) the root cause. will re-test it once the dependency is updated here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants