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

  • Home
  • SEARCH
  • 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 7060515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:21:43+00:00 2026-05-28T04:21:43+00:00

I have successfully installed & configured the M2E Maven plugin for Eclipse, along with

  • 0

I have successfully installed & configured the M2E Maven plugin for Eclipse, along with Android SDK and ADT.

I want to create Android Projects from inside Maven, and so I found this article which gives instructions on installing the Android-Maven Plugin, and using a pre-existing Android-Maven archetype for initializing a project.

I followed the instructions to a “T” and got the project “mavenified” beautifully.

The only problem is, I’m used to (and really like!) the following typical Maven directory structure:

src/
    main/
        resources/
        java/
    test/
        resources/
        java/

However, this archetype doesn’t seem to contain a src/test/* directory, only a src/main/* tree. How do I get the test “subtree” in their?

I guess I have two options:

  • Find a different Android-Maven archetype that contains it; or
  • Manually add the test/resources and test/java source folders myself

I wouldn’t even know where to begin looking for the first option, and, quite frankly, I’m scared to try the second! I’ve heard that changing an archetype’s directory structure can really mess up the build.

What would SO suggest? Is there anything obvious that I’m missing here? Thanks in advance!

  • 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-28T04:21:44+00:00Added an answer on May 28, 2026 at 4:21 am

    Check out the Notes section from their Getting Started page here:

    Notes:

    1. Do not put tests in src/test/java that you want to be run by the Android Maven Plugin. If you put your tests there, Maven runs them as normal JUnit tests in the JVM, with the JAR files that are accessible on the classpath, which includes the android.jar. Because the android.jar only contains empty methods that throw exceptions, you get exceptions of the form java.lang.RuntimeException: Stub!. Instead, the tests need to go in src/main/java, where they will not be run by Maven as tests during compilation, but will be included in the apk and deployed and run on the device (where the android.jar has method implementations instead of stubs).
    2. If you have JUnit tests that don’t call any Android APIs (directly or transitively), put them in src/test/java so JUnit runs them locally and more quickly than if run on the device.
    3. Make sure the Android Maven goal is set to jar-no-fork instead of test-jar-no-fork. Do this even for projects that only contain tests.

    UPDATE:
    The most suitable "test" subtree IMO is src/test/java, as stated in the second point, as long as you JUnit tests are purely POJO test which doesn’t involve any Android API call, you will be fine.

    I use src/test/java for all Robolectric junit test with instrumented test in separate Android test project, all managed by maven, everything works fine for me.

    Checkout the Sample MorseFlash project here, which include src/test/java as a example.

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

Sidebar

Related Questions

I have successfully installed: 1) IntelliJ IDEA 10.0.3 with Lua Plugin 2) Corona SDK
I have successfully installed following items as i want to Integrate Facebook Chat Into
I want to create an OpenOffice.org plug-in that adds a sidebar. I have successfully
I have successfully installed the Cycle plugin for Jquery and have my banners cycling
I have successfully installed and configured gitosis on an Ubuntu server. We're currently just
I have just successfully installed CakePHP and I see that I can edit the
My issue is regarding PhoneGap and Android development using the Eclipse Applaud plugin. I
I have successfully installed the Clearance Gem from ThoughtBot. Clearance sends a confirmation email
I have successfully installed SVN on a Windows XP machine and can connect to
I am trying to use jqplot http://www.jqplot.com/tests/cursor-highlighter.php . I have successfully installed it in

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.