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, using a lifecycle mapping seemed to resolve a lot my issues,
your help is  much appreciated.

I appreciate you guys have just released a new version, but when do you
think you guys will release a new version of m2eclipse with
MNGECLIPSE-2555 fixed?

TIA...

-- 
Ricardo Gladwell <ricardo.gladwell@xxxxxxxxx>
http://www.google.com/profiles/ricardo.gladwell
Twitter: @axonrg - MSN: axonrg@xxxxxxxxx 

On Sun, 2010-11-21 at 22:07 -0500, Igor Fedorenko wrote:
> As I mentioned, NPE are caused by MNGECLIPSE-2555. You need to specify
> versions of all Maven plugins used by the project, which is a good thing
> regardless of m2e the bug. I've attached pom.xml diff to save you some
> typing.
> 
> In order to avoid adding explicit lifecycle mapping to all apk projects,
> you need to provide ILifecycleMapping implementation like [1] and
> register it as default mapping via an extension point (see
> m2eclipse-tycho plugin.xml for details).
> 
> [1] 
> https://github.com/sonatype/m2eclipse-tycho/blob/master/org.sonatype.tycho.m2e/src/org/sonatype/tycho/m2e/internal/TychoLifecycleMapping.java
> 
> --
> Regards,
> Igor
> 
> On 10-11-21 07:26 AM, Ricardo Gladwell wrote:
> > 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...
> >
> >
> >
> >
> > _______________________________________________
> > m2e-dev mailing list
> > m2e-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/m2e-dev
> _______________________________________________
> m2e-dev mailing list
> m2e-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/m2e-dev



Back to the top