tesla / m2eclipse-tycho

25 stars 26 forks source link

[Maven-Bundle-Plugin]Generate Manifest when a maven project is added #39

Open apupier opened 6 years ago

apupier commented 6 years ago

currently it is generated when a dependency is modified: https://github.com/tesla/m2eclipse-tycho/blob/08cafef88546233e65150cf05cc92e0ea7116f7d/org.sonatype.tycho.m2e/src/org/sonatype/tycho/m2e/felix/internal/MavenBundlePluginConfigurator.java#L322-L323

In case of import of a pre-configured Maven project in a new workspace (with .project), we need to listen to MavenProjectChangedEvent.KIND_ADDED too

apupier commented 6 years ago

for reference, issue discovered while working on https://issues.jboss.org/browse/FUSETOOLS-2183

apupier commented 6 years ago

@fbricon can you have a look please?

apupier commented 6 years ago

seems my first was not right. It was fixing the issue "sometimes" only.

What I observed today for the project attached in https://issues.jboss.org/browse/FUSETOOLS-2183 :

I'm able to workaround it by adding a check if the target/classes/META-INF/MANIFEST.MF exists when calculating the "generate" boolean: https://github.com/tesla/m2eclipse-tycho/blob/08cafef88546233e65150cf05cc92e0ea7116f7d/org.sonatype.tycho.m2e/src/org/sonatype/tycho/m2e/felix/internal/MavenBundlePluginConfigurator.java#L108-L118

I'm not able to reproduce the issue with a simple project, neither programmatically.