Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6865311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:01:39+00:00 2026-05-27T03:01:39+00:00

I have an android project, I use maven to manage it and it works

  • 0

I have an android project, I use maven to manage it and it works well in command line. The construction as below:

My Project

|–android
|—-src
|—-pom.xml
|—-……
|–common
|—-src
|—-assets
|—-repo
|–desktop
|–pom.xml

I put shared code and assets in common directory. and the pom.xml in android directory is:

<project>
........
<dependencies>
    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android</artifactId>
        <version>2.2.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>com.badlogic.gdx</groupId>
    <artifactId>gdx</artifactId>
    <version>0.9.1</version>
    </dependency>
    <dependency>
    <groupId>com.badlogic.gdx</groupId>
    <artifactId>gdx-backend-android</artifactId>
    <version>0.9.1</version>
    </dependency>
    <dependency>
    <groupId>com.google.ads</groupId>
    <artifactId>GoogleAdMobAdsSdk</artifactId>
    <version>4.0.4</version>
    </dependency>
</dependencies>
<build>
    <finalName>${project.artifactId}</finalName>
    <sourceDirectory>src</sourceDirectory>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <version>3.0.0-alpha-14</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 or api level (api level 4 = platform 1.6)-->
                    <platform>8</platform>
                </sdk>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals><goal>add-source</goal></goals>
                    <configuration>
                        <sources>
                            <source>../common/src</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <resources>
    <resource>
        <directory>../common/assets</directory>
    </resource>
    </resources>
</build>
<repositories>
  <repository>
<id>libs</id>
<url>file://${basedir}/../common/repo/</url>
  </repository>
</repositories>
</project>

As you can see above, I set addition src dir with build-helper-maven-plugin, and set the resource dir to common/src, I also have a local repository in common/repo to manage my 3rd lib.

Everything is fine when I use command line, I can ‘mvn install android:deploy’ with my phone. However when I import it into Eclipse with M2E, I confront below problems

The addition src directory I added in pom.xml didn’t show in the Eclipse workspace, so the code in android/src can’t find the package.

If I link source folder manually in Eclipse, it tell me should update the maven configuration, and I did, another error”Cannot nest ‘android/gen’ inside ‘android’. To enable nesting exclude ‘gen’ from ‘android'” show up.

I totally confused by this mess. Anyone confront the same problem and why I can use maven in command line and can’t in M2E, thank you?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:01:40+00:00Added an answer on May 27, 2026 at 3:01 am

    I figured it out, a mistake in my pom.xml.

    After add maven-compiler-plugin info to pom.xml, everything is OK.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on an Android project where I'd have to use maven.
I would use Jmagick into an Android Project. Is it possible? I have to
I have a project for visualizing some data on tablet. I'll probably use android
I have an Android project for which I use the Eclipse IDE and I
I have an android project and I want to use some classes from another
I have a mono android project. I can use monodevelop to build the apk
I tried to use Proguard in my Android project, i setup Proguard using command
I have an Android 2.2 project that I need to use the facebook api
I am trying to get setup to use Maven and pom.xml files in Eclipse
I have a working Android tuner project app that I want to use as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.