You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Andreas Sewe (JIRA)" <ji...@apache.org> on 2017/08/13 20:31:01 UTC

[jira] [Commented] (FELIX-5677) No dependency-reduced POM is created if embedded dependencies are inlined

    [ https://issues.apache.org/jira/browse/FELIX-5677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16125042#comment-16125042 ] 

Andreas Sewe commented on FELIX-5677:
-------------------------------------

Looking at the code rather than the documentation, it is clear why the {{maven-bundle-plugin}} behaves the way it does: {{DependencyEmbedder.processDependencies}} only adds an {{Artifact}} to the list of embedded dependencies if it is *not* inlined.

I think the simplest fix would be to maintain a separate set of {{m_inlinedArtifacts}}, alongside {{m_inlinedPaths}} and {{m_embeddedArtifacts}}, and remove both the {{m_inlinedArtifacts}} and the {{m_embeddedArtifacts}} from the dependency reduced POM.

If there is interest, I could provide a patch, as I *really* need this functionality.

> No dependency-reduced POM is created if embedded dependencies are inlined
> -------------------------------------------------------------------------
>
>                 Key: FELIX-5677
>                 URL: https://issues.apache.org/jira/browse/FELIX-5677
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-3.3.0
>         Environment: Maven home: /Users/sewe/apache-maven-3.5.0
> Java version: 1.8.0_111, vendor: Oracle Corporation
> Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"
>            Reporter: Andreas Sewe
>         Attachments: example.zip
>
>
> The [{{maven-bundle-plugin:bundle}}|https://felix.apache.org/components/bundle-plugin/bundle-mojo.html#createDependencyReducedPom] documentation says
> bq. createDependencyReducedPom: If true, remove any inlined or embedded dependencies from the resulting pom.
> This is *not* true. As the attached minimal example project shows, the dependency ({{om.google.guava:guava:21.0}}) is inlined, but no {{dependency-reduced-pom.xml}} is created on a {{mvn clean install}}.
> If you change
> {noformat}
> <Embed-Dependency>guava;inline=true</Embed-Dependency>
> {noformat}
> to
> {noformat}
> <Embed-Dependency>guava;inline=false</Embed-Dependency>
> {noformat}
> the {{dependency-reduced-pom.xml}} is correctly created (with the Guava dependency removed) and installed into the local Maven repository.
> I tried for hours using different combinations of {{Export-Package}}, {{Embed-Dependency}}, and {{_exportcontents}}, but couldn’t find a workaround. :-(



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)