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

Paul Rütter (BlueConic) edited comment on FELIX-6030 at 3/18/24 9:31 AM:
-------------------------------------------------------------------------

For future reference; 
[https://bnd.bndtools.org/instructions/bundleannotations.html]

In the maven instructions for the maven-bundle-plugin:
{code:java}
<_bundleannotations></_bundleannotations>{code}
This will disable annotation scanning for _all_ classes.



Ran into the same issue when using apache-poi, which includes log4j: 
[https://github.com/apache/logging-log4j2/blob/baf18f6da30b09c2e184d945adfd8c9eec39ac66/log4j-api/src/main/java/org/apache/logging/log4j/util/Activator.java#L51]


was (Author: paul_blueconic):
For future reference; 
[https://bnd.bndtools.org/instructions/bundleannotations.html]

 

In the maven instructions for the maven-bundle-plugin:
{code:java}
<_bundleannotations></_bundleannotations>{code}
Ran into the same issue when using apache-poi, which includes log4j: 
[https://github.com/apache/logging-log4j2/blob/baf18f6da30b09c2e184d945adfd8c9eec39ac66/log4j-api/src/main/java/org/apache/logging/log4j/util/Activator.java#L51]

> @Header in gogo.jline causing maven-bundle-plugin failure
> ---------------------------------------------------------
>
>                 Key: FELIX-6030
>                 URL: https://issues.apache.org/jira/browse/FELIX-6030
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo JLine
>    Affects Versions: gogo.jline-1.1.2
>            Reporter: Jean-Baptiste Onofré
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: gogo.jline-1.1.4
>
>
> In the https://svn.apache.org/viewvc?view=revision&revision=1849343 revision, 
> Gogo JLine bundle {{Activator}} now contains:
> {code}
> @Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}")
> {code}
> In Karaf, we "wrap" {{gogo.jline}} in Karaf {{shell.core}}:
> {code}
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <configuration>
>                     <instructions>
>                         <Import-Package>
>                             org.osgi.service.event;resolution:=optional,
>                             org.apache.karaf.branding;resolution:=optional,
>                             !org.apache.felix.gogo.jline*,
>                             !org.apache.sshd.*,
>                             *   
>                         </Import-Package>
>                         <Export-Package>
>                             
> org.apache.karaf.shell.api.*;version=${project.version},
>                             
> org.apache.karaf.shell.support.*;version=${project.version},
>                             org.apache.felix.service.command,
>                             org.apache.felix.service.threadio
>                         </Export-Package>
>                         <Private-Package>
>                             org.apache.karaf.service.guard.tools,
>                             org.apache.karaf.shell.impl.*,
>                             org.apache.karaf.util,
>                             org.apache.karaf.util.filesstream,
>                             org.apache.karaf.util.jaas,
>                             org.apache.karaf.util.tracker,
>                             org.apache.felix.utils.properties,
>                             org.apache.felix.utils.extender,
>                             org.apache.felix.utils.manifest,
>                             org.apache.felix.gogo.jline,
>                             org.apache.felix.gogo.runtime,
>                             org.apache.felix.gogo.runtime.threadio,
>                             org.apache.felix.service.command,
>                             org.apache.felix.service.threadio,
>                         </Private-Package>
>                         <Provide-Capability>
>                             
> osgi.service;effective:=active;objectClass=org.apache.karaf.shell.api.console.SessionFactory
>                         </Provide-Capability>
>                         <Bundle-Activator>
>                             org.apache.karaf.shell.impl.console.osgi.Activator
>                         </Bundle-Activator>
>                         <Main-Class>
>                             
> org.apache.karaf.shell.impl.console.standalone.Main
>                         </Main-Class>
>                     </instructions>
>                     <unpackBundle>true</unpackBundle>
>                 </configuration>
>             </plugin>
> {code}
> Since the introduction of {{@Header}} in Felix Gogo JLine, the build fails 
> with:
> {code}
> [ERROR] Bundle 
> org.apache.karaf.shell:org.apache.karaf.shell.core:bundle:4.2.3-SNAPSHOT : 
> The Bundle-Activator header only supports a single type. The following types 
> were found: 
> org.apache.karaf.shell.impl.console.osgi.Activator,org.apache.felix.gogo.jline.Activator.
>  This usually happens when a macro resolves to multiple types
> [ERROR] Error(s) found in bundle configuration
> {code}
> [~rotty3000] do you know a workaround in the {{maven-bundle-plugin}} about 
> that ? If not, do you mind if I remove {{@Header}} from Gogo JLine Activator ?
> Thanks.
> JB



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

Reply via email to