karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grzegorz Grzybek (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (KARAF-4329) Consider bundles from override.properties while creating the assembly
Date Sat, 02 Dec 2017 14:38:00 GMT

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

Grzegorz Grzybek edited comment on KARAF-4329 at 12/2/17 2:37 PM:
------------------------------------------------------------------

With KARAF-5376, I have considered:
* {{overrides.properties}} that may be found during assembly creation (e.g., from one of KARs)
- but this is now deprecated
* {{org.apache.karaf.features.xml}} - a new configuration file that's used both for blacklisting
and overriding of both features and bundles
* {{override.}} prefixed properties in profiles - deprecated

Also - all overrides are downloaded instead of original artifacts. Now, having:
{code:xml}
<bundleReplacements>
    <bundle replacement="mvn:org.jboss.logging/jboss-logging/3.3.1.Final" mode="osgi" />
    <bundle originalUri="mvn:javax.servlet/javax.servlet-api/[3,4)"
            replacement="mvn:javax.servlet/javax.servlet-api/3.1-b09" mode="maven" />
</bundleReplacements>
{code}

We can see in the logs:
{noformat}
[INFO] --- karaf-maven-plugin:4.2.0-SNAPSHOT:assembly (default-assembly) @ test-karaf-plugins
---
[INFO] Using repositories:
[INFO]    https://repo.maven.apache.org/maven2@id=central
...
[INFO] Found features processor configuration: ../classes/etc/org.apache.karaf.features.xml
...
[INFO] Generating features processor configuration: etc/org.apache.karaf.features.xml
[INFO] Startup stage
[INFO]    Loading startup repositories
[INFO]    Resolving startup features and bundles
[INFO]       Features: undertow, my-startup-feature
[INFO]       Bundles: mvn:commons-beanutils/commons-beanutils/1.9.2, mvn:commons-collections/commons-collections/3.2.2,
mvn:commons-logging/commons-logging/1.2, mvn:commons-io/commons-io/2.4
...
[INFO]       adding maven artifact: mvn:javax.servlet/javax.servlet-api/3.1-b09
...
[INFO] Boot stage
...
[INFO]    Feature undertow/1.3.25.1 is defined as a boot feature
...
[INFO]       adding overriden maven artifact: mvn:org.jboss.logging/jboss-logging/3.3.1.Final
(original location: mvn:org.jboss.logging/jboss-logging/3.3.0.Final)
...
[INFO]       adding overriden maven artifact: mvn:javax.servlet/javax.servlet-api/3.1-b09
(original location: mvn:javax.servlet/javax.servlet-api/3.1.0)
...
[INFO] Install stage
[INFO]    Loading installed repositories
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
{noformat}

{{osgi}} mode of override uses rules known from {{etc/overrides.properties}} - symbolic name
must match, version (possibly from {{range}} clause) must be compatible and version of override
must be higher of the overriden one.

In {{maven}} mode of override, we don't care about symbolic names - assuming user knows what
(s)he's doing - maybe replacing javax.\* bundles with SMX ones? Or vice versa?

We wouldn't be able to override servlet-api 3.1.0 with 3.1-b09 (which is 3.0.99.b09 in MANIFEST.MF)
in {{osgi}} mode, but we can do it in {{maven}} mode.
Example of overriding jboss-logging is a _compatibility_ option with old {{etc/overrides.properties}}
(which are not properties after all: KARAF-4181)


was (Author: gzres):
With KARAF-5376, I have considered:
* {{overrides.properties}} that may be found during assembly creation (e.g., from one of KARs)
- but this is now deprecated
* {{org.apache.karaf.features.xml}} - a new configuration file that's used both for blacklisting
and overriding of both features and bundles
* {{override.}} prefixed properties in profiles - deprecated

Also - all overrides are downloaded instead of original artifacts. Now, having:
{code:xml}
<bundleReplacements>
    <bundle originalUri="mvn:org.jboss.logging/jboss-logging/[3,4)"
            replacement="mvn:org.jboss.logging/jboss-logging/3.3.1.Final" mode="osgi" />
    <bundle originalUri="mvn:javax.servlet/javax.servlet-api/[3,4)"
            replacement="mvn:javax.servlet/javax.servlet-api/3.1-b09" mode="maven" />
</bundleReplacements>
{code}

We can see in the logs:
{noformat}
[INFO] --- karaf-maven-plugin:4.2.0-SNAPSHOT:assembly (default-assembly) @ test-karaf-plugins
---
[INFO] Using repositories:
[INFO]    https://repo.maven.apache.org/maven2@id=central
...
[INFO] Found features processor configuration: ../classes/etc/org.apache.karaf.features.xml
...
[INFO] Generating features processor configuration: etc/org.apache.karaf.features.xml
[INFO] Startup stage
[INFO]    Loading startup repositories
[INFO]    Resolving startup features and bundles
[INFO]       Features: undertow, my-startup-feature
[INFO]       Bundles: mvn:commons-beanutils/commons-beanutils/1.9.2, mvn:commons-collections/commons-collections/3.2.2,
mvn:commons-logging/commons-logging/1.2, mvn:commons-io/commons-io/2.4
...
[INFO]       adding maven artifact: mvn:javax.servlet/javax.servlet-api/3.1-b09
...
[INFO] Boot stage
...
[INFO]    Feature undertow/1.3.25.1 is defined as a boot feature
...
[INFO]       adding overriden maven artifact: mvn:org.jboss.logging/jboss-logging/3.3.1.Final
(original location: mvn:org.jboss.logging/jboss-logging/3.3.0.Final)
...
[INFO]       adding overriden maven artifact: mvn:javax.servlet/javax.servlet-api/3.1-b09
(original location: mvn:javax.servlet/javax.servlet-api/3.1.0)
...
[INFO] Install stage
[INFO]    Loading installed repositories
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
{noformat}

{{osgi}} mode of override uses rules known from {{etc/overrides.properties}} - symbolic name
must match, version (possibly from {{range}} clause) must be compatible and version of override
must be higher of the overriden one.

In {{maven}} mode of override, we don't care about symbolic names - assuming user knows what
(s)he's doing - maybe replacing javax.\* bundles with SMX ones? Or vice versa?

> Consider bundles from override.properties while creating the assembly
> ---------------------------------------------------------------------
>
>                 Key: KARAF-4329
>                 URL: https://issues.apache.org/jira/browse/KARAF-4329
>             Project: Karaf
>          Issue Type: Improvement
>          Components: karaf-tooling
>    Affects Versions: 4.1.0, 4.0.4
>            Reporter: Krzysztof Sobkowiak
>            Assignee: Grzegorz Grzybek
>             Fix For: 4.2.0
>
>
> The assembly goal of the karaf-maven-plugin should check an override.properties and always
 populate system folder with bundles defined there



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

Mime
View raw message