如何创建可以作为Android项目导入的Maven项目

时间:2022-03-21 17:17:03

I am a fan of Maven and love the freedom it gives me and my fellow programmers when collaborating on a project. I consider myself to have a fairly good understanding of Maven and its pom as well as the command line goals.

我是Maven的粉丝,喜欢在项目合作时给予我和我的同事们的*。我认为自己对Maven及其pom以及命令行目标有相当好的理解。

Now we are starting to create an android test project to test our Android software in an automatic way. We have no problems doing this from within the eclipse environment and the test suite is now up and running.

现在我们开始创建一个Android测试项目,以自动方式测试我们的Android软件。我们在eclipse环境中执行此操作没有任何问题,现在测试套件已启动并运行。

However, its time to include more programmers into this project and therefore we want to be able to clone this project from our git repository, run mvn eclipse:eclipse, import it into a fresh eclipse (of course with android-sdk and what not) and run the tests as is expected.

但是,是时候将更多的程序员包含在这个项目中,因此我们希望能够从我们的git存储库中克隆这个项目,运行mvn eclipse:eclipse,将其导入一个新的eclipse(当然还有android-sdk,什么不是)并按预期运行测试。

We stumble over the hurdle that the project doesn't become an Android Test Project within eclipse thus it is not possible to run Android JUnit on any of its classes.

我们偶然发现项目未成为eclipse中的Android测试项目的障碍因此无法在其任何类上运行Android JUnit。

The main question: How do we make the project become an Android Test Project from the terminal window after it has been cloned from Git?

主要问题:在从Git克隆后,我们如何使项目从终端窗口成为Android测试项目?

1 个解决方案

#1


0  

You can manually add android nature to the project by adding it in the .project file and then opening eclipse again.

您可以通过在.project文件中添加android属性然后再次打开eclipse来手动将android性质添加到项目中。

<nature>com.android.ide.eclipse.adt.AndroidNature</nature>

You can create an empty android test project, and then compare it's .project file with your project's.

您可以创建一个空的android测试项目,然后将它的.project文件与您的项目进行比较。

#1


0  

You can manually add android nature to the project by adding it in the .project file and then opening eclipse again.

您可以通过在.project文件中添加android属性然后再次打开eclipse来手动将android性质添加到项目中。

<nature>com.android.ide.eclipse.adt.AndroidNature</nature>

You can create an empty android test project, and then compare it's .project file with your project's.

您可以创建一个空的android测试项目,然后将它的.project文件与您的项目进行比较。