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/resourcesandtest/javasource 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!
Check out the Notes section from their Getting Started page here:
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.