Hi,

i would like to add a line into my manifest.mf when the .jar is created
with netbeans 7.0.1.
This is my pom.xml:

<profiles>
        <profile>
            <id>build-for-felix</id>
            <dependencies>
                <dependency>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>org.apache.felix.main</artifactId>
                    <version>3.0.7</version>
                    <scope>provided</scope>
                </dependency>
                <!-- To include a shell:
                <dependency>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>org.apache.felix.gogo.shell</artifactId>
                    <version>0.6.1</version>
                </dependency>
                -->
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>compile</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <pathconvert
property="plugins.jars" pathsep="${path.separator}">
                                            <path
refid="maven.runtime.classpath"/>
                                            <map
from="${project.build.directory}${file.separator}classes" to=""/>
                                        </pathconvert>
                                        <pathconvert pathsep=" "
property="bundles">
                                            <path path="${plugins.jars}"/>
                                            <mapper>
                                                <chainedmapper>
                                                    <flattenmapper/>
                                                    <globmapper from="*"
to="file:modules/*" casesensitive="no"/>
                                                </chainedmapper>
                                            </mapper>
                                        </pathconvert>
                                        <propertyfile
file="${project.build.directory}/config.properties">
                                            <entry
key="felix.auto.start" value="${bundles}
file:modules/${project.build.finalName}.jar"/>
                                            <entry
key="org.osgi.framework.bootdelegation" value="*"/>
                                        </propertyfile>
                                        <copy
file="${maven.dependency.org.apache.felix.org.apache.felix.main.jar.path}"
tofile="${project.build.directory}/felix.jar"/>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.2</version>
                        <executions>                        
                            <execution>
                                <id>create-executable-jar</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <configuration>
                                    <descriptors>
                                       
<descriptor>${basedir}/src/main/assembly/felix.xml</descriptor>
                                    </descriptors>
                                   
<finalName>${project.build.finalName}</finalName>
                                   
<archive>                                      
                                        <manifestEntries>
                                           
<SPI-Consumer>javax.sound.sampled.AudioSystem#getAudioInputStream</SPI-Consumer>
                                       
</manifestEntries>                                     
                                    </archive>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>                            
                       
<groupId>org.codehaus.mojo</groupId>                             
                       
<artifactId>exec-maven-plugin</artifactId>                             
                        <version>1.1</version>                             
                        <executions>                                 
                           
<execution>                                           
                               
<phase>verify</phase>                                         
                               
<goals>                                             
                                   
<goal>exec</goal>                                           
                               
</goals>                                         
                            </execution>                               
                        </executions>                              
                        <configuration>                                   
                           
<executable>java</executable>                                 
                           
<workingDirectory>${project.build.dir}</workingDirectory>                       
            

                           
<arguments>                                          
                                <argument>-jar</argument>   
                               
<argument>org.apache.aries.spifly.static.tool-0.4-SNAPSHOT-jar-with-dependencies.jar</argument>
                               
<argument>target/${project.build.finalName}.jar</argument>                      
                                                   
            
                            </arguments>                             
                        </configuration>                            
                    </plugin> 
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-clean-plugin</artifactId>
                        <version>2.2</version>
                        <configuration>
                           
<excludeDefaultDirectories>true</excludeDefaultDirectories>
                            <filesets>
                                <fileset>
                                    <directory>${basedir}/target</directory>
                                    <includes>
                                       
<include>${project.build.finalName}.jar</include>                               
      

                                    </includes>
                                    <excludes>
                                       
<exclude>${project.build.finalName}-spifly.jar</exclude>                        
             

                                    </excludes>
                                    <followSymlinks>false</followSymlinks>
                                </fileset>
                            </filesets>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

The problem is in the maven-assembly-plugin. the code:
<archive>                                      
                                        <manifestEntries>
                                           
<SPI-Consumer>javax.sound.sampled.AudioSystem#getAudioInputStream</SPI-Consumer>
                                       
</manifestEntries>                                     
                                    </archive>
is just not executed and i dont know why...
the line that should be added somewhere in the manifest.mf looks like:
SPI-Consumer: javax.sound.sampled.AudioSystem#getAudioInputStream

i also posted at
http://www.coderanch.com/t/561974/tools/maven-adding-line-manifest-mf#2551534


thanks

oli

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to