[ 
https://issues.apache.org/jira/browse/MNG-8336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guillaume Nodet reassigned MNG-8336:
------------------------------------

    Assignee: Guillaume Nodet

> Cannot parse POM <packaging>bundle</packaging>
> ----------------------------------------------
>
>                 Key: MNG-8336
>                 URL: https://issues.apache.org/jira/browse/MNG-8336
>             Project: Maven
>          Issue Type: Bug
>          Components: Core, POM
>    Affects Versions: 4.0.0-beta-5
>         Environment:  Apache Maven 4.0.0-beta-5 
> (6e78fcf6f5e76422c0eb358cd11f0c231ecafbad)
> Maven home: /home/runner/work/maven-repro/maven-repro/maven
> Java version: 21.0.4, vendor: Eclipse Adoptium, runtime: 
> /usr/lib/jvm/temurin-21-jdk-amd64
> Default locale: en, platform encoding: UTF-8
> OS name: "linux", version: "6.5.0-1025-azure", arch: "amd64", family: "unix"
>            Reporter: Daniel Schmid
>            Assignee: Guillaume Nodet
>            Priority: Major
>             Fix For: 4.0.0-beta-6
>
>
> The currently (as of the time of writing) proposed version for Maven 
> 4.0.0-beta-5 seems to contain a change resulting in a ModelBuilderException 
> in org.codehaus.mojo:license-maven-plugin when a dependency with 
> <packaging>bundle</packaging> is included but that plugin seems to continue 
> building.
> It seems like such a POM can no longer be parsed by Maven according to the 
> stack trace:
>  
> {code:java}
> [WARNING] Unable to obtain POM for artifact: 
> org.apache.pdfbox:pdfbox-io:jar:3.0.2:compile
> org.apache.maven.project.ProjectBuildingException: Some problems were 
> encountered while processing the POMs
>     at 
> org.apache.maven.project.DefaultProjectBuilder$BuildSession.build(DefaultProjectBuilder.java:397)
>     at 
> org.apache.maven.project.DefaultProjectBuilder$BuildSession.build(DefaultProjectBuilder.java:441)
>     at 
> org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:176)
>     at 
> org.codehaus.mojo.license.api.DependenciesTool.loadProjectDependencies(DependenciesTool.java:169)
>     at 
> org.codehaus.mojo.license.api.DefaultThirdPartyHelper.loadDependencies(DefaultThirdPartyHelper.java:159)
>     at 
> org.codehaus.mojo.license.AddThirdPartyMojo.loadDependencies(AddThirdPartyMojo.java:199)
>     at 
> org.codehaus.mojo.license.AbstractAddThirdPartyMojo.init(AbstractAddThirdPartyMojo.java:739)
>     at 
> org.codehaus.mojo.license.AbstractLicenseMojo.execute(AbstractLicenseMojo.java:151)
>     at 
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:339)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:310)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:214)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:179)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:168)
>     at 
> org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:165)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:107)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
>     at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:60)
>     at 
> org.apache.maven.lifecycle.internal.DefaultLifecycleStarter.execute(DefaultLifecycleStarter.java:123)
>     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:311)
>     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:225)
>     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:149)
>     at 
> org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.doExecute(DefaultMavenInvoker.java:470)
>     at 
> org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.execute(DefaultMavenInvoker.java:108)
>     at 
> org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.execute(DefaultMavenInvoker.java:76)
>     at 
> org.apache.maven.cling.invoker.LookupInvoker.doInvoke(LookupInvoker.java:238)
>     at 
> org.apache.maven.cling.invoker.LookupInvoker.invoke(LookupInvoker.java:213)
>     at org.apache.maven.cling.ClingSupport.run(ClingSupport.java:68)
>     at org.apache.maven.cling.MavenCling.main(MavenCling.java:51)
>     at 
> jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>     at java.lang.reflect.Method.invoke(Method.java:580)
>     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:255)
>     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:201)
>     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:361)
>     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:314)
> Caused by: org.apache.maven.api.services.ModelBuilderException: 1 problem was 
>  for org.apache.pdfbox:pdfbox-io:bundle:3.0.2
>     - [ERROR] Unknown packaging: bundle @ line 31, column 5
>     at 
> org.apache.maven.internal.impl.model.DefaultModelBuilder$DefaultModelBuilderSession.newModelBuilderException(DefaultModelBuilder.java:532)
>     at 
> org.apache.maven.internal.impl.model.DefaultModelBuilder$DefaultModelBuilderSession.buildEffectiveModel(DefaultModelBuilder.java:863)
>     at 
> org.apache.maven.internal.impl.model.DefaultModelBuilder$1.build(DefaultModelBuilder.java:229)
>     at 
> org.apache.maven.project.DefaultProjectBuilder$BuildSession.build(DefaultProjectBuilder.java:370)
>     at 
> org.apache.maven.project.DefaultProjectBuilder$BuildSession.build(DefaultProjectBuilder.java:441)
>     at 
> org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:176)
>     at 
> org.codehaus.mojo.license.api.DependenciesTool.loadProjectDependencies(DependenciesTool.java:169)
>     at 
> org.codehaus.mojo.license.api.DefaultThirdPartyHelper.loadDependencies(DefaultThirdPartyHelper.java:159)
>     at 
> org.codehaus.mojo.license.AddThirdPartyMojo.loadDependencies(AddThirdPartyMojo.java:199)
>     at 
> org.codehaus.mojo.license.AbstractAddThirdPartyMojo.init(AbstractAddThirdPartyMojo.java:739)
>     at 
> org.codehaus.mojo.license.AbstractLicenseMojo.execute(AbstractLicenseMojo.java:151)
>     at 
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:339)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:310)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:214)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:179)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:168)
>     at 
> org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:165)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:107)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
>     at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:60)
>     at 
> org.apache.maven.lifecycle.internal.DefaultLifecycleStarter.execute(DefaultLifecycleStarter.java:123)
>     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:311)
>     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:225)
>     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:149)
>     at 
> org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.doExecute(DefaultMavenInvoker.java:470)
>     at 
> org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.execute(DefaultMavenInvoker.java:108)
>     at 
> org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.execute(DefaultMavenInvoker.java:76)
>     at 
> org.apache.maven.cling.invoker.LookupInvoker.doInvoke(LookupInvoker.java:238)
>     at 
> org.apache.maven.cling.invoker.LookupInvoker.invoke(LookupInvoker.java:213)
>     at org.apache.maven.cling.ClingSupport.run(ClingSupport.java:68)
>     at org.apache.maven.cling.MavenCling.main(MavenCling.java:51)
>     at 
> jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>     at java.lang.reflect.Method.invoke(Method.java:580)
>     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:255)
>     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:201)
>     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:361)
>     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:314) 
> {code}
> This didn't happen with 4.0.0-beta-4.
>  
> Steps to reproduce:
>  * Include org.apache.pdfbox:pdfbox-io:3.0.2 as a depdendency (which uses 
> <packaging>bundle</packaging>
>  * Run mvn clean org.codehaus.mojo:license-maven-plugin:2.4.0:add-third-party
>  * An exception occurs in the build log saying the POM cannot be processed
> Full reproducer using GitHub Actions: 
> [https://github.com/danthe1st/maven-repro/tree/license]
> Build log where the exception occurs (actual result, Maven 4.0.0-beta-5): 
> [https://github.com/danthe1st/maven-repro/actions/runs/11426889340/job/31790373783]
> Build log where the exception doesn't occur (expected result, Maven 
> 4.0.0-beta-4): 
> [https://github.com/danthe1st/maven-repro/actions/runs/11426889340/job/31790373659]
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to