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

Steven Spungin commented on FELIX-5171:
---------------------------------------

I need to generate a manifest before using pax-exam and I experience similar 
issues.  The Service-Component xml descriptors are 'merged' into the existing 
ones instead of replacing them.  This happens even if <exportScr> is not 
enabled. 

Workaround:
Clean the manifest file first.  Make sure this is BEFORE the 
maven-bundle-plugin in the POM, as it is bound to the same phase.

{noformat}
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.6.1</version>
                <executions>
                    <execution>
                        <id>clean-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                        <configuration>
                            
<excludeDefaultDirectories>true</excludeDefaultDirectories>
                            <filesets>
                                <fileset>
                                    
<directory>target/classes/META-INF</directory>
                                    <includes>
                                        <include>MANIFEST.MF</include>
                                    </includes>
                                </fileset>
                            </filesets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
{noformat}

> Duplicate Service-Component generated from the manifest goal
> ------------------------------------------------------------
>
>                 Key: FELIX-5171
>                 URL: https://issues.apache.org/jira/browse/FELIX-5171
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-3.0.1
>            Reporter: J. Brébec
>
> My project are configured with the packaging "jar" and use the manifest goal 
> to generate a manifest, referenced by the maven-jar-plugin.
> When i "mvn install" a bundle with the -dsannotations directive, without a 
> "clean", the Service-Component header contains duplicated xml file references.
> In fact, the plugin merge the new generated manifest with the old one, in 
> "target/classes/META-INF/MANIFEST.MF" which was generated by a previous 
> compilation. If i compile N times, the xml files are referenced N times. when 
> this bundle is deployed, SCR log an exception



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

Reply via email to