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

Grzegorz Grzybek edited comment on KARAF-4181 at 12/2/17 2:54 PM:
------------------------------------------------------------------

I changed it like this:

# If during assembly construction we have preconfigured 
{{etc/org.apache.karaf.features.xml}} (e.g., in resource KAR), blacklisted 
repos/features/bundles will be used from this file (see: KARAF-5376), e.g.:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>

<featuresProcessing 
xmlns="http://karaf.apache.org/xmlns/features-processing/v1.0.0";>

    <blacklistedRepositories>
        <repository>mvn:org.spring/*</repository>
    </blacklistedRepositories>

    <blacklistedBundles>
        
<bundle>mvn:org.ops4j.pax.tipi/org.ops4j.pax.tipi.undertow.websocket-jsr</bundle>
    </blacklistedBundles>

...
</featuresProcessing>
{code}
# If karaf-maven-plugin configuration includes:
{code:xml}
<configuration>
...
    <blacklistedRepositories>
        <repository>mvn:org.jclouds/*</repository>
    </blacklistedRepositories>
    <blacklistedFeatures>
        <feature>*jclouds*</feature>
    </blacklistedFeatures>
    <blacklistedBundles>
        <bundle>mvn:org.ops4j.pax.cdi/*</bundle>
    </blacklistedBundles>
...
</configuration>
{code}
These will be used as well
# After I fix KARAF-5339, profile-defined blacklists will also be used

With the above, we can see in Maven build 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] Creating work directory: 
/data/sources/_testing/grgr-test-karaf-plugins/target/assembly
...
[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]       skipping blacklisted maven bundle: 
mvn:org.ops4j.pax.tipi/org.ops4j.pax.tipi.undertow.websocket-jsr/1.3.25.1
...
[INFO] Boot stage
...
[INFO]    Feature undertow/1.3.25.1 is defined as a boot feature
[INFO]       adding maven artifact: 
mvn:javax.annotation/javax.annotation-api/1.2
...
[INFO]       skipping blacklisted maven artifact: 
mvn:org.ops4j.pax.tipi/org.ops4j.pax.tipi.undertow.websocket-jsr/1.3.25.1
...
[INFO] Install stage
[INFO]    Loading installed repositories
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
{noformat}

And target assembly will have {{etc/org.apache.karaf.features.xml}} regenerated 
(merging information from different sources):
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Configuration generated by Karaf Assembly Builder
-->
<featuresProcessing 
xmlns="http://karaf.apache.org/xmlns/features-processing/v1.0.0"; 
xmlns:f="http://karaf.apache.org/xmlns/features/v1.5.0";>

    <!-- A list of blacklisted features XML repository URIs - they can't be 
added later -->
    <blacklistedRepositories>
        <repository>mvn:org.spring/*</repository>
        <repository>mvn:org.jclouds/*</repository>
    </blacklistedRepositories>

    <!-- A list of blacklisted feature identifiers that can't be installed in 
Karaf and are not part of the distribution -->
    <blacklistedFeatures>
        <feature>*jclouds*</feature>
    </blacklistedFeatures>

    <!-- A list of blacklisted bundle URIs that are not installed even if they 
are part of some features -->
    <blacklistedBundles>
        
<bundle>mvn:org.ops4j.pax.tipi/org.ops4j.pax.tipi.undertow.websocket-jsr</bundle>
        <bundle>mvn:org.ops4j.pax.cdi/*</bundle>
    </blacklistedBundles>
...
</featuresProcessing>
{code}



was (Author: gzres):
I changed it like this:

# If during assembly construction we have preconfigured 
{{etc/org.apache.karaf.features.xml}} (e.g., in resource KAR), blacklisted 
repos/features/bundles will be used from this file (see: KARAF-5376)
# If karaf-maven-plugin configuration includes:
{code:xml}
<configuration>
...
    <blacklistedRepositories>
        <repository>mvn:org.jclouds/*</repository>
    </blacklistedRepositories>
    <blacklistedFeatures>
        <feature>*jclouds*</feature>
    </blacklistedFeatures>
    <blacklistedBundles>
        <bundle>mvn:org.ops4j.pax.cdi/*</bundle>
    </blacklistedBundles>
...
</configuration>
{code}
These will be used as well
# After I fix KARAF-5339, profile-defined blacklists will also be used

With the above, we can see in Maven build 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] Creating work directory: 
/data/sources/_testing/grgr-test-karaf-plugins/target/assembly
...
[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]       skipping blacklisted maven bundle: 
mvn:org.ops4j.pax.tipi/org.ops4j.pax.tipi.undertow.websocket-jsr/1.3.25.1
...
[INFO] Boot stage
...
[INFO]    Feature undertow/1.3.25.1 is defined as a boot feature
[INFO]       adding maven artifact: 
mvn:javax.annotation/javax.annotation-api/1.2
...
[INFO]       skipping blacklisted maven artifact: 
mvn:org.ops4j.pax.tipi/org.ops4j.pax.tipi.undertow.websocket-jsr/1.3.25.1
...
[INFO] Install stage
[INFO]    Loading installed repositories
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
{noformat}

And target assembly will have {{etc/org.apache.karaf.features.xml}} regenerated 
(merging information from different sources):
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Configuration generated by Karaf Assembly Builder
-->
<featuresProcessing 
xmlns="http://karaf.apache.org/xmlns/features-processing/v1.0.0"; 
xmlns:f="http://karaf.apache.org/xmlns/features/v1.5.0";>

    <!-- A list of blacklisted features XML repository URIs - they can't be 
added later -->
    <blacklistedRepositories>
        <repository>mvn:org.spring/*</repository>
        <repository>mvn:org.jclouds/*</repository>
    </blacklistedRepositories>

    <!-- A list of blacklisted feature identifiers that can't be installed in 
Karaf and are not part of the distribution -->
    <blacklistedFeatures>
        <feature>*jclouds*</feature>
    </blacklistedFeatures>

    <!-- A list of blacklisted bundle URIs that are not installed even if they 
are part of some features -->
    <blacklistedBundles>
        
<bundle>mvn:org.ops4j.pax.tipi/org.ops4j.pax.tipi.undertow.websocket-jsr</bundle>
        <bundle>mvn:org.ops4j.pax.cdi/*</bundle>
    </blacklistedBundles>
...
</featuresProcessing>
{code}


> blacklist.properties and overrides.properties are not properties file
> ---------------------------------------------------------------------
>
>                 Key: KARAF-4181
>                 URL: https://issues.apache.org/jira/browse/KARAF-4181
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-profile
>    Affects Versions: 4.0.3
>            Reporter: Benson Margulies
>            Assignee: Grzegorz Grzybek
>             Fix For: 4.2.0
>
>
> It's confusing that a file named 'blacklist.properties' does not, in fact, 
> contain a properties file. Rather, it's just a list of blacklisted bundles. 
> It seems to me that the name 'blacklist.properties' might be deprecated and 
> the name 'bundle-blacklist.txt' would be more informative.



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

Reply via email to