Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] [m2eclipse-dev] m2eclipse extensions that modify project classpath

Hi Igor

Thanks for the feedback, I really appreciate your help. I'm still
getting some problems, unfortunately:

On Sun, 2010-11-14 at 18:08 -0500, Igor Fedorenko wrote:
> Depending on what changes you need to make to raw classpath, you may
> need to use m2e 0.12.0, which is currently available from staged
> repository [1]. See MNGECLIPSE-2313 [2] for details.

I installed the 0.12.0 version of the m2eclipse plugin, but the
configureRawClasspath method on my IJavaProjectConfigurator is still not
being called. The configureClasspath is being called, but the changes to
the classpath here do not seem to be taking.

> There are currently couple of ways to make this work. You can setup
> custom build lifecycle mapping using pom.xml snippet like below.
> Alternatively, you can provide default lifecycle mapping for projects
> with packaging=apk (I can provide pointers if you are interested).

Interesting, any advice you can provide here would be useful.

>    <profiles>
>      <profile>
>        <id>m2e</id>
>        <activation>
>          <property>
>            <name>m2e.version</name>
>          </property>
>        </activation> snip...

Sorry, I'm not sure, do you mean I should add that XML to my Android
project POM? Is that what the plugin.xml "generic" boolean flag for
projectConfigurators indicates?

If I do put this into my pom.xml, I get a NPE (see attached).

> Also, you almost certainly want to avoid running "mvn package" during
> incremental build (this is what current implementation of
> AndroidMavenBuildParticipant does). It runs on each resource change
> (think Ctrl-S in editor) and takes many seconds even for most simple
> projects. It can also cause infinite build, because same output files
> are changed by Eclipse JDT/ADT builders and by Maven mojos. Why do you
> need to run any mojos? Can't you rely on ADT to do everything needed?

This is unfortunate and it's something I'd like to change. The problem
is that the ADT project builder does not include Maven dependency JAR
files when building the the binary application blob, so we need to
replace it with the a maven-based project build participant. To create
incremental builds would require changes to the underlying
maven-android-plugin which is something I'm planning to do, but in the
meantime I'd just like to get this problem with configureRawClasspath
fixed so I can at least get something up and working.

The reason there is an infinite build is because the JDT maven project
configurator adds the target/generated-sources/r directory, so each time
we do a maven build, it refreshes the generated class files here,
causing a further build, hence the infinite loop. This target generated
source folder is what I am trying to remove from the project classpath
in the call to configureRawClasspath.

Also the ADT automatically creates a /gen source folder, so if the Maven
android plugin also adds an identical generated source folder it creates
duplicate class build errors.

TIA...

-- 
Ricardo Gladwell <ricardo.gladwell@xxxxxxxxx>
http://www.google.com/profiles/ricardo.gladwell
Twitter: @axonrg - MSN: axonrg@xxxxxxxxx 
java.lang.NullPointerException
at org.apache.maven.plugin.DefaultPluginDescriptorCache$CacheKey.<init>(DefaultPluginDescriptorCache.java:164)
at org.apache.maven.plugin.DefaultPluginDescriptorCache.createKey(DefaultPluginDescriptorCache.java:62)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:130)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:251)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:197)
at org.maven.ide.eclipse.internal.embedder.MavenImpl.getMojoParameterValue(MavenImpl.java:765)
at org.maven.ide.eclipse.jdt.internal.AbstractJavaProjectConfigurator.addProjectSourceFolders(AbstractJavaProjectConfigurator.java:248)
at org.maven.ide.eclipse.jdt.internal.AbstractJavaProjectConfigurator.configure(AbstractJavaProjectConfigurator.java:99)
at org.maven.ide.eclipse.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:57)
at org.maven.ide.eclipse.internal.project.CustomizableLifecycleMapping.configure(CustomizableLifecycleMapping.java:120)
at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:306)
at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:292)
at org.maven.ide.eclipse.actions.UpdateSourcesAction$1.runInWorkspace(UpdateSourcesAction.java:92)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)



Back to the top