In my eclipse workspace, saving a file in a java editor makes m2e run defaultGoal (install) on the project, which involves rewritting the MANIFEST.MF file. Because I am using another plugin that has no m2e connector (maven-scr-plugin), this makes my manifest file useless.
What I would like to do is prevent the maven-bundle-plugin from being executed on save, and I've so far come up with two possible solutions:
You can edit the eclipse lifecycle mappings, but this just won't do the trick for some reason (I do think it should):
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<versionRange>[0.0,)</versionRange>
<goals>
<goal>instructions</goal>
<goal>bundle</goal>
<goal>manifest</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
Alternatively, changing the defaultGoal
in my pom.xml's <build>
to something like compile
would also mean not getting to the point where the bundle plugin kicks in, but I'd really hate to change my pom because of an eclipse peculiarity.
Is there a way to define a defaultGoal for the m2e plugin? Do you guys have any other approach for this? Thanks!