android - maven 无法从原型(prototype)创建项目

标签 android maven

我已经安装了 eclipse helios、android sdk(放在我的路径中)、用于 eclipse 的 android m2e 插件和 Maven 3.0.3(也在我的路径中)。我可以很好地创建普通的 android 项目。我正在尝试通过 eclipse 使用 Maven 创建一个项目,我选择了“de.akquinet.android.archetypes”android-quickstart Archetype,每次都会出现以下错误。

'Creating android-quickstart' has encountered a problem.

Unable to create proejct from archetype [de.akquinet.android.archetypes:android-quickstart:1.0.8 -> ]

Unable to create project from archetype [de.akquinet.android.archetypes:android-quickstart:1.0.8 -> ] The desired archetype does not exist (de.akquinet.android.archetypes:android-quickstart:1.0.8)

我错过了什么步骤?

最佳答案

首先安装最新版本的 Maven (3.1.x)。

之后,在 Eclipse 中执行以下操作:

New -> Maven Project -> (next) -> Add Archetype 并输入:

Archetype Group Id: de.akquinet.android.archetypes
Archetype Artifact Id: android-quickstart
Archetype Version: 1.1.0

然后输入您的项目信息(groupId、artifactId、package)并完成向导。

如果这不可行,请尝试使用命令行创建项目:

mvn archetype:generate \
  -DarchetypeArtifactId=android-quickstart \
  -DarchetypeGroupId=de.akquinet.android.archetypes \
  -DarchetypeVersion=1.1.0 \
  -DgroupId=your.company \
  -DartifactId=my-android-application

然后在Eclipse中导入。

请记住,m2eclipse 还不够,还需要m2e-android:http://rgladwell.github.io/m2e-android/

关于android - maven 无法从原型(prototype)创建项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16248796/

相关文章:

Android:如何在 JSONStringer 中为 Web 服务请求设置编码?

java - 以编程方式解决插件外部的 Maven 依赖关系 - 获取 RepositorySystemSession 和 RepositorySystem

java - 在 Maven 中指定源和测试文件夹的 IntelliJ 包前缀

maven - 缺少适用于 QBO 的 Intuit Java V3 SDK 的父 pom

java - @Component Scan 无法在 Spring Boot 中跨 jar 和 war 使用 @Component

android - 在完整的应用程序中隐藏滚动条

android - 在哪里可以找到旧版本的 Eclipse ADT

c# - 如何从 Android 应用程序中为 Android 类调用 Mono?

android - 从其他 fragment 返回时, fragment 内的 Recyclerview 为空

java - maven central 是否希望共享源 URL?