Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] m2e plugins for code generators?

Hey.

I have been messing a bit around with making a small m2e plugin to (re-)enable jaxws and jaxb2 and jibx maven plugins.

For my purposes the jibx one is easy to just set to action "execute". But jaxws and jaxb2 generates source that needs to be in the build environment.

I've been looking at what is at the m2e extras github repo and eventually came up with making a simple project configurator that extends org.eclipse.m2e.jdt.AbstractJavaProjectConfigurator and just returns the correct source folder when being asked (overwriting getSourceFolders).

That seems to work just fine for a jar project (or bundle as it happens to be). But for a WAR project I am getting an exception such as this: java.lang.NoSuchMethodError: org.eclipse.m2e.core.MavenPlugin.getMavenProjectManager()Lorg/eclipse/m2e/core/project/MavenProjectManager; at org.maven.ide.eclipse.wtp.AbstractProjectConfiguratorDelegate.<init>(AbstractProjectConfiguratorDelegate.java:70) at org.maven.ide.eclipse.wtp.WebProjectConfiguratorDelegate.<init>(WebProjectConfiguratorDelegate.java:72) at org.maven.ide.eclipse.wtp.ProjectConfiguratorDelegateFactory.getProjectConfiguratorDelegate(ProjectConfiguratorDelegateFactory.java:35) at org.maven.ide.eclipse.wtp.WTPProjectConfigurator.mavenProjectChanged(WTPProjectConfigurator.java:74) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.mavenProjectChanged(ProjectConfigurationManager.java:753) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:724) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:847) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:93) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


Now the question is if I should be adding generated source folders this way? Or am I doing something wrong that triggers issues with the wtp integration?

As a side question I'd ask if perhaps some optional source bundles could be made available for m2e. So writing these things would be a bit easier (at least if there happens to be a bit of JavaDoc in the source)? I'd attact the source manually. But it seems PDE won't allow you to attach source to plug-in dependencies.

/Kristoffer Peterhänsel


Back to the top