m2e-android and Eclipse Luna

297 views
Skip to first unread message

Kalle Korhonen

unread,
Jul 3, 2014, 3:15:42 PM7/3/14
to maven-androi...@googlegroups.com
Looks like I was a little early with my upgrade from Eclipse Kepler to Luna. After the upgrade, the "Non-runtime Maven dependencies" classpath is gone and all dependencies are tacked under "Maven dependencies" regardless of scope and none will be added to apk. What I patched together from reading the comments on Github issues (https://github.com/rgladwell/m2e-android/issues/220 and https://github.com/rgladwell/m2e-android/issues/224) is that Luna comes with m2e 1.5 but there's no official version/update site for 1.5 compatible version of m2e-android ready yet. Is that correct? I got the relevant stack traces but looks like @rtack and @rgladwell are on top of the issue. Is there anything more I should try out, can help with or best to just sit tight?

Kalle

Kalle Korhonen

unread,
Jul 4, 2014, 2:09:14 AM7/4/14
to maven-androi...@googlegroups.com
Ah I see from reading comments in #205 that the main issue is with the package name change from org.sonatype.aether to org.eclipse.aether and that there's already a m2e-1.5 branch, so looks like the remaining issue is getting a 1.5 specific update site up. Hope you guys can get that figured out.

Kalle

Ricardo Gladwell

unread,
Jul 4, 2014, 7:07:52 AM7/4/14
to maven-androi...@googlegroups.com
I'll be trying to work on it this weekend without breaking backwards compatibility for for m2e 1.4 or less. This is tricky, because Google distribute Kepler as part of their Eclipse ADT download.

Kalle Korhonen

unread,
Jul 7, 2014, 12:00:31 AM7/7/14
to maven-androi...@googlegroups.com
Thanks Ricardo, I really appreciate your efforts.

Kalle


--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kalle Korhonen

unread,
Jul 7, 2014, 11:32:24 PM7/7/14
to maven-androi...@googlegroups.com
While waiting for the de-facto official solution, I built and installed rtack/m2e-1.5. That got me past the package naming conflicts but I was thoroughly baffled for some time why one of my projects worked just fine whereas another refused to even create "Non-Runtime Maven Dependencies". Instead, it added a JRE classpath container on the build path (I think I've seen some SO/emails about this issue). The only difference is that one project was using android-maven-plugin version 3.0.0-alpha-14 and another the latest stable (3.8.2,, also tried 3.9.0 rcs). Just to verify my results, I made a duplicate of the project using 3.0.0-alpha-14 and updated to a newer version, and sure enough, even 3.0.2 didn't work anymore. I'm not even sure what the connection is between m2e-android and android-maven-plugin. In Eclipse, I'm using the latest embedded (3.2.1/1.5.0-...) and command-line environment includedes Maven 3.2.2. Perhaps this is just a simple setting and/or something I've missed in the change notes but please let me know if so.

Kalle

Ricardo Gladwell

unread,
Jul 8, 2014, 5:08:06 AM7/8/14
to maven-androi...@googlegroups.com
That sounds like a bug we fixed on master, you might want to merge the latest code into @rtack's m2e-1.5 branch.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-developers+unsub...@googlegroups.com.

Kalle Korhonen

unread,
Jul 8, 2014, 2:03:23 PM7/8/14
to maven-androi...@googlegroups.com
Merged the master to m2e-1.5 and rebuilt but the same problem persists. It's entirely possible I messed up something though. In any case, I'll stick with 3.0.0-alpha-14 for now and try out the new m2e release once available.

Kalle


To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-deve...@googlegroups.com.

Ricardo Gladwell

unread,
Jul 9, 2014, 5:37:33 AM7/9/14
to maven-androi...@googlegroups.com
If the problem persists after the new release of m2e-android (which will hopefully support Luna) please raise an issue.

-- 
@rgladwell

On 8 July 2014 at 19:03:23, Kalle Korhonen (kalle.o....@gmail.com) wrote:

Merged the master to m2e-1.5 and rebuilt but the same problem persists. It's entirely possible I messed up something though. In any case, I'll stick with 3.0.0-alpha-14 for now and try out the new m2e release once available.

Kalle
On Tue, Jul 8, 2014 at 2:08 AM, Ricardo Gladwell <ricardo....@gmail.com> wrote:
That sounds like a bug we fixed on master, you might want to merge the latest code into @rtack's m2e-1.5 branch.


On Tuesday, 8 July 2014 04:32:24 UTC+1, Kalle Korhonen wrote:
While waiting for the de-facto official solution, I built and installed rtack/m2e-1.5. That got me past the package naming conflicts but I was thoroughly baffled for some time why one of my projects worked just fine whereas another refused to even create "Non-Runtime Maven Dependencies". Instead, it added a JRE classpath container on the build path (I think I've seen some SO/emails about this issue). The only difference is that one project was using android-maven-plugin version 3.0.0-alpha-14 and another the latest stable (3.8.2,, also tried 3.9.0 rcs). Just to verify my results, I made a duplicate of the project using 3.0.0-alpha-14 and updated to a newer version, and sure enough, even 3.0.2 didn't work anymore. I'm not even sure what the connection is between m2e-android and android-maven-plugin. In Eclipse, I'm using the latest embedded (3.2.1/1.5.0-...) and command-line environment includedes Maven 3.2.2. Perhaps this is just a simple setting and/or something I've missed in the change notes but please let me know if so.

Kalle
On Sun, Jul 6, 2014 at 9:00 PM, Kalle Korhonen <kalle.o....@gmail.com> wrote:
Thanks Ricardo, I really appreciate your efforts.

Kalle
On Fri, Jul 4, 2014 at 4:07 AM, Ricardo Gladwell <ricardo....@gmail.com> wrote:
I'll be trying to work on it this weekend without breaking backwards compatibility for for m2e 1.4 or less. This is tricky, because Google distribute Kepler as part of their Eclipse ADT download.


On Friday, 4 July 2014 07:09:14 UTC+1, Kalle Korhonen wrote:
Ah I see from reading comments in #205 that the main issue is with the package name change from org.sonatype.aether to org.eclipse.aether and that there's already a m2e-1.5 branch, so looks like the remaining issue is getting a 1.5 specific update site up. Hope you guys can get that figured out.

Kalle


On Thu, Jul 3, 2014 at 12:15 PM, Kalle Korhonen <kalle.o....@gmail.com> wrote:
Looks like I was a little early with my upgrade from Eclipse Kepler to Luna. After the upgrade, the "Non-runtime Maven dependencies" classpath is gone and all dependencies are tacked under "Maven dependencies" regardless of scope and none will be added to apk. What I patched together from reading the comments on Github issues (https://github.com/rgladwell/m2e-android/issues/220 and https://github.com/rgladwell/m2e-android/issues/224) is that Luna comes with m2e 1.5 but there's no official version/update site for 1.5 compatible version of m2e-android ready yet. Is that correct? I got the relevant stack traces but looks like @rtack and @rgladwell are on top of the issue. Is there anything more I should try out, can help with or best to just sit tight?

Kalle

--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Maven Android Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/maven-android-developers/tAjY1ZRz-x4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to maven-android-deve...@googlegroups.com.

Kalle Korhonen

unread,
Jul 14, 2014, 1:15:07 PM7/14/14
to maven-androi...@googlegroups.com
Ok, I updated to version 1.0.2.201407131228 and there are no exceptions during boot-up so looks like this version should work for Luna, but unfortunately I'm still getting the JRE lib on the classpath and "Non-Runtime..." library when using android-maven-plugin anything newer than 3.0.0-alpha-14. Now, I would think more people should see this if it's not only a problem in my environment. I can open an issue with details but any hunch what could cause it, things I should try or plugin versions I should update?

Kalle

Ricardo Gladwell

unread,
Jul 14, 2014, 1:17:49 PM7/14/14
to maven-androi...@googlegroups.com
Hi Kalle,

Sounds like this is a separate issue from the others. It sounds as though m2e-android isn’t detecting your project as being an Android project for some reason.

Please raise a ticket according to the guidelines here:


A sample POM or even test project would really help us narrow down on the issue.

Regards...

-- 
@rgladwell

Kalle Korhonen

unread,
Jul 14, 2014, 2:26:13 PM7/14/14
to maven-androi...@googlegroups.com
Thanks Ricardo. I have the same issue with any Android/Maven project. If I create new project using the de.akquinet.android.archetypes/android-quickstart, it's not created with Android nature. If I edit the .project and .classpath configurations manually to add the nature and the ANDROID_FRAMEWORK classpath entry, I end up with the same problem. If I then change the android plugin version to 3.0.0-alpha-14, it'll start working. The problem is, I don't see any obvious problems in the logs so I'll try to dig up some more information first before opening an issue.

Kalle

Kalle Korhonen

unread,
Jul 15, 2014, 2:25:16 AM7/15/14
to maven-androi...@googlegroups.com
I still couldn't figure it out but I'm not sure that this is an m2e-android issue. m2e-android works with 3.0.0-alpha-14 and before but not with anything after that. 3.0.0 does not work and it's somehow related to the contents of the plugin.xml. I compared the differences a bit but it's almost 9000 lines so a lot of content to shift through. I made a quick test by taking the plugin.xml from 3.0.0-alpha-14, changing the version number to 3.0.0 and re-zipping it up with contents of 3.0.0 and that works as well. It does look like m2e-android configurator is just bypassed in this case for some reason. ...workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration gives me:

2014-07-14 22:52:28,286 [Worker-1] INFO  o.e.m.c.i.l.LifecycleMappingFactory - Using DEFAULT lifecycle mapping for MavenProject: com.test.m2e_androidtest:androidtest-m2e2:0.0.1-SNAPSHOT @ C:\Users\kaosko\workspace\androidtest-m2e2\pom.xml.
2014-07-14 22:52:28,461 [Worker-1] INFO  o.e.m.j.i.AbstractJavaProjectConfigurator - Adding source folder /androidtest-m2e2/src/main/java
2014-07-14 22:52:28,462 [Worker-1] INFO  o.e.m.j.i.AbstractJavaProjectConfigurator - Adding source folder /androidtest-m2e2/src/test/java
2014-07-14 22:52:29,273 [Worker-1] INFO  o.e.m.c.i.p.ProjectConfigurationManager - Update completed: 1 sec

for a configuration that doesn't work and this:

2014-07-14 23:10:58,907 [Worker-86] INFO  o.e.m.j.i.AbstractJavaProjectConfigurator - Adding source folder /androidtest-m2e2/src/main/java
2014-07-14 23:10:58,908 [Worker-86] INFO  o.e.m.j.i.AbstractJavaProjectConfigurator - Adding source folder /androidtest-m2e2/src/test/java
2014-07-14 23:11:01,734 [Worker-86] INFO  o.e.m.j.i.AbstractJavaProjectConfigurator - Adding source folder /androidtest-m2e2/src/main/java
2014-07-14 23:11:01,735 [Worker-86] INFO  o.e.m.j.i.AbstractJavaProjectConfigurator - Adding source folder /androidtest-m2e2/src/test/java
2014-07-14 23:11:05,078 [Worker-86] INFO  o.e.m.c.i.p.ProjectConfigurationManager - Update completed: 15 sec

for a configuration that does work, so not much help there but you can see the time difference. The issue is fully reproducible. Otherwise I would have suspected an issue in the embedded Maven but MavenAndroidProjectFactory.createAndroidProject() is supposed to throw an error if the plugin is not found. As you can see from above, I'm on Windows (7/64-bit). I haven't tested on Linux yet but I wouldn't be surprised if this was platform specific. Below is an example pom for a project I've tested with.

Kalle


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.test.m2e_androidtest</groupId>
    <artifactId>androidtest-m2e2</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>apk</packaging>
    <name>androidtest-m2e2</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <platform.version> 4.1.1.4
            </platform.version>
            <!-- 3.8.2  3.0.0-alpha-14 3.0.0  3.9.0-rc.1 -->
        <android.plugin.version>3.0.0</android.plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <version>${platform.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <finalName>${project.artifactId}</finalName>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <version>${android.plugin.version}</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <configuration>
                    <sdk>
                        <platform>16</platform>
                    </sdk>
                                    </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Ricardo Gladwell

unread,
Jul 15, 2014, 7:44:29 AM7/15/14
to maven-androi...@googlegroups.com
Just copied that POM and it worked fine on my Mac OS X machine so this maybe a windows 7 issue.

Can I confirm that you do not see this if you use the android-maven-plugin 3.0.0-alpha-14 or lower?

You only get the error if you use 3.0.0 or 3.9.0-rc2 or 3.8.2?

Have you checked your ${workspace}/.metadata/.log file as any relevant looking exceptions in it?

-- 
@rgladwell

Kalle Korhonen

unread,
Jul 15, 2014, 1:15:19 PM7/15/14
to maven-androi...@googlegroups.com
On Tue, Jul 15, 2014 at 4:44 AM, Ricardo Gladwell <ricardo....@gmail.com> wrote:
Just copied that POM and it worked fine on my Mac OS X machine so this maybe a windows 7 issue.
Can I confirm that you do not see this if you use the android-maven-plugin 3.0.0-alpha-14 or lower?

Yeah, I'm not surprised it works on OS X. That's correct, 3.0.0-alpha-14 or lower works.

You only get the error if you use 3.0.0 or 3.9.0-rc2 or 3.8.2?

Yes, I've also tried 3.0.2, 3.1.0, 3.5.0, 3.6.0, 3.6.1 and 3.9.0.rc.1, neither of which work.
 
Have you checked your ${workspace}/.metadata/.log file as any relevant looking exceptions in it?

Yes, absolutely and I see nothing relevant.

Kalle

 

Kalle Korhonen

unread,
Jul 15, 2014, 4:48:10 PM7/15/14
to maven-androi...@googlegroups.com
Proguard support was introduced in android-maven-plugin 3.0.0. Turns out I can fix my issue by modifying the plexus/components.xml to change the line "com.jayway.maven.plugins.android.generation2:android-maven-plugin:proguard" back to
"com.jayway.maven.plugins.android.generation2:android-maven-plugin:unpack"

in the <process-classes> of any android-maven-plugin version and then re-zipping up the jar. The unpack goal is deprecated but still available. I just modified 3.8.2 as outlined and that fixed the build. I'm rather baffled why the proguard goal breaks the whole m2e-android configurator for me. Could I be missing some dependency that doesn't show up in the logs? Any other guesses?

Kalle

Ricardo Gladwell

unread,
Jul 16, 2014, 6:24:42 AM7/16/14
to maven-androi...@googlegroups.com, Kalle Korhonen
Hey Kalle,

Thanks for your investigation into this. This has been a difficult to reproduce bug so we haven’t been able to narrow down on a cause yet. Not sure why the pro guard goal would be breaking m2e-android but it gives me a place to start coming up with a fix.

I don’t believe this should be a problem with the android-maven-plugin.

I’ve opened a ticket here:


Please subscribe and continue any further discussion about this issue there.

Regards…

-- 
@rgladwell
Reply all
Reply to author
Forward
0 new messages