English 中文(简体)
Anders Maven Directory Institutions
原标题:Android Maven Directory Structure

我已成功安装和安装;把Eclipse的M2E Maven假胜地以及AndersSDK和ADT混为一谈。

我想从inside上创建安康项目。 Maven, and so, I found this article,其中指示安装Andan-Maven Plugin,并使用先前的Andre-Maven arche型项目启动。

我遵循了“T”的指示,美丽地完成了“简化”项目。

唯一的问题是,我曾经(而且真象!) 下述典型的Maven名录结构:

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

然而,这种等级类型似乎含有<条码>src/test/*目录,但只有<条码>src/main/*树。 www.un.org/Depts/DGACM/index_spanish.htm 我如何在“子树”试验?

我想我有两个选择:

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

我甚至不知道在什么地方开始寻找第一种选择,而且坦率地说,我是scared,以尝试第二个选择! 我听到,改变一种等级型的目录结构能够真正为建筑群铺垫。

什么是SO? 我在这里失踪的人是否明显? 提前感谢!

最佳回答

http://code.google.com

注:

  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 in separate instrumented test 甲型测试项目由ven子管理,对我来说,所有东西都做了罚款。

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

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签