On 19 Oct 2011, at 00:06, Matt Madhavan wrote:

> Hello,
> I have a question on the manifestLocation directive!. 
> 
> Currently my parent pom has the following! 
> <manifestLocation>src/main/resources/META-INF</manifestLocation>
> So the MANIFEST.MF is being created at this location as expected. (I had to 
> do this to fool IBM RAD).
> 
> Since this file is generated, when I do Mvn Clean should n't the Maven Felix 
> Plugin delete this file if it exists? I think if the maven Felix plugin has 
> the manifestLocation entry then it should safely assume that this file is a 
> generated file and delete the file MANIFEST.MF. 

Currently the "bundle" packaging type doesn't override the default clean phase 
- the bundleplugin does have a bundle:clean goal, but that's specifically about 
cleaning stale entries from the local OBR rather than removing generated files 
(and we definitely don't want to run this goal on every "mvn clean"). 
Automatically removing generated files is also not expected maven behaviour, 
people generally prefer to remove such files themselves. For example if you 
used the manifest goal to generate an initial manifest then you wouldn't want 
it removed on every clean. But if you do want to remove the generated manifest 
then you can always configure the maven-clean-plugin like so:

   
http://maven.apache.org/plugins/maven-clean-plugin/examples/delete_additional_files.html

  <plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <configuration>
      <filesets>
        <fileset>
          <directory>META-INF</directory>
          <followSymlinks>false</followSymlinks>
          <includes>
            <include>**/MANIFEST.MF</include>
          </includes>
        </fileset>
      </filesets>
    </configuration>
  </plugin>

> This results in some unwanted behavior even a bug! Sometimes the generated 
> file gets checked in to CVS. Next time when I do a maven install of the 
> bundle the old manifest does not get overridden and gets into the jar file!

Sounds more like a bug I fixed recently in trunk, where an existing manifest in 
the "manifestLocation" would be merged rather than replaced - if you try the 
latest snapshot:

   
https://repository.apache.org/content/repositories/snapshots/org/apache/felix/maven-bundle-plugin/2.4.0-SNAPSHOT/

it should behave better. Note that with the latest release of m2e and Eclipse 
3.7 you should also be able to import and work with Maven bundle projects 
without setting the manifestLocation to be outside of the target directory 
(just use the "Auto Select" button on the configurator page while importing so 
it will install the m2e-tycho configurator).

> Any ideas?
> 
> Thanks in advance!
> 
> Matt
> 
> 
> 

_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to