karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Rathgeb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-3597) features-generate-descriptor ignoring runtime dependencies
Date Mon, 09 Nov 2015 11:53:10 GMT

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

Markus Rathgeb commented on KARAF-3597:
---------------------------------------

Has this been reproduced? I build a working example to reproduce this issue, too.
For karaf-maven-plugin 4.0.2 the Dependency31Helper (same for Dependency30Helper with different
line numbers) builds the dependency tree using the getDependencyTree function (line 106ff).
The ScopeDependencySelector2 function (used through ScopeDependencySelector1 -- see function
comment) filters the test and runtime scopes.

So, why do we filter runtime scope?

Let's consider the following example:
An artifact contains a configuration file that contains e.g. some class name that should be
used for a given functionality. That configured value is read at runtime and used. So, the
referenced class and the artifact that contains that class is only needed at runtime.
Is this not a very "normal" use case for Spring / JSP where you configure classes in XML files?
Sure, we could configure the dependency with scope compile instead of runtime to get the karaf-maven-plugin
working, but that would be just a workaround. We could also configure that dependency in the
feature file themselves, but IMHO then I does not need the feature-generation is I have to
do such thing manually.

For "provided" and "test" the filtering is clear to me.

Why have you decided to filter the runtime scope out?

> features-generate-descriptor ignoring runtime dependencies
> ----------------------------------------------------------
>
>                 Key: KARAF-3597
>                 URL: https://issues.apache.org/jira/browse/KARAF-3597
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-tooling
>    Affects Versions: 3.0.3
>         Environment: Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
> Maven home: /usr/local/Cellar/maven/3.2.5/libexec
> Java version: 1.7.0_67, vendor: Oracle Corporation
> Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "10.10.2", arch: "x86_64", family: "mac"
>            Reporter: Damian ONeill
>            Assignee: Jean-Baptiste Onofré
>              Labels: features-generate-descriptor
>         Attachments: pom.xml
>
>
> When running the following command 
> $ mvn -U karaf:features-generate-descriptor
> The generated feature.xml file does not contain any bundle definitions for dependencies
defined with scope runtime.
> For e.g. 
>  <dependencies>
>         <dependency>
>             <groupId>javax.xml.bind</groupId>
>             <artifactId>jaxb-api</artifactId>
>         </dependency>
>         <dependency>
>             <groupId>com.sun.xml.bind</groupId>
>             <artifactId>jaxb-impl</artifactId>
>             <scope>runtime</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.jvnet.jaxb2_commons</groupId>
>             <artifactId>jaxb2-basics-runtime</artifactId>
>         </dependency>
>     </dependencies>
> results in 
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.2.1" name="resourcesModel">
>     <feature name="resourcesModel" version="6.0-SNAPSHOT" description="resourcesModel">
>         <details>9001 is the proNX brand name for the EMS Core.</details>
>         <bundle>wrap:mvn:javax.xml.bind/jaxb-api/2.1</bundle>
>         <bundle>wrap:mvn:javax.xml.stream/stax-api/1.0-2</bundle>
>         <bundle>wrap:mvn:javax.activation/activation/1.1</bundle>
>         <bundle>mvn:org.jvnet.jaxb2_commons/jaxb2-basics-runtime/0.6.4</bundle>
>     </feature>
> </features>
> Note no bundle definition for jaxb-impl defined with runtime scope above.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message