Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
apupier opened this issue Feb 19, 2018 · 3 comments
Open

Comments

@apupier
Copy link

apupier commented Feb 19, 2018

currently it is generated when a dependency is modified:

if ( MavenProjectChangedEvent.KIND_CHANGED == event.getKind()
&& MavenProjectChangedEvent.FLAG_DEPENDENCIES == event.getFlags() )

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 added a commit to apupier/m2eclipse-tycho that referenced this issue Feb 19, 2018
@apupier
Copy link
Author

apupier commented Feb 19, 2018

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

apupier added a commit to apupier/m2eclipse-tycho that referenced this issue Feb 19, 2018
@apupier
Copy link
Author

apupier commented Mar 6, 2018

@fbricon can you have a look please?

@apupier
Copy link
Author

apupier commented Mar 23, 2018

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 :

  • the MANIFEST.MF is first generated
  • then the JavaBuilder is cleaning some folders, including target/classes/META-INF
    see org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(boolean)

I'm able to workaround it by adding a check if the target/classes/META-INF/MANIFEST.MF exists when calculating the "generate" boolean:

boolean generate = IncrementalProjectBuilder.FULL_BUILD == kind;
// the property is set by OsgiBundleProjectConfigurator.mavenProjectChanged is a workaround for
// m2e design limitation, which does not allow project configurators trigger resource deltas
// visible to build participants. See comment in OsgiBundleProjectConfigurator.mavenProjectChanged
generate =
generate || Boolean.parseBoolean( (String) project.getSessionProperty( PROP_FORCE_GENERATE ) );
// reset FORCE flag so we don't regenerate forever
project.setSessionProperty( PROP_FORCE_GENERATE, null );
generate = generate || isIncludeBndFileChange( buildContext, instructions );

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant