【问题标题】:Maven archetype generate and open in eclipseMaven 原型在 Eclipse 中生成并打开
【发布时间】:2014-11-21 13:00:55
【问题描述】:

我在 github (https://github.com/alapierre/altkom) 下找到了一个 Eclipse 原型。我下载了 zip 文件并尝试从这个原型生成一个项目并在我的 Eclipse 中运行它。关键是我总是得到“找不到原型”? 您能否提供一种从该工件生成项目的方法?

我已经尝试过以下几种变化:

mvn archetype:generate -DarchetypeGroupId=pl.com.softproject.archetypes.springmvc -DarchetypeArtifactId=spring-mvc-spring-data-archetype -DarchetypeVersion=1.0-SNAPSHOT -DgroupId=com.test -DartifactId=myNewProject

最后我也得到了

Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.2:generate (default-cli) on project spring-mvc-spring-data-archetype: org.apach
e.maven.archetype.exception.InvalidPackaging: Unable to add module to the curren
t project as it is not of packaging type 'pom'

有什么想法吗?

【问题讨论】:

    标签: java eclipse maven maven-archetype


    【解决方案1】:

    好的,问题是我试图在与原型相同的目录中运行 mvn generate,这就是问题所在。

    【讨论】:

      【解决方案2】:

      在您可以使用原型之前,您需要将它安装在 Maven 可以找到它的地方。

      在包含pom.xml 文件的原型文件夹中运行mvn install。之后,它应该可以工作了。

      【讨论】:

      • 嗨,我知道我必须安装 mvn(忘了说我已经完成了 - 抱歉)...所以问题出在其他问题上
      • 看来你有几个问题。你能把每个问题缩小到一个问题吗?什么具体不起作用,错误消息是什么,您预计会发生什么?
      猜你喜欢
      • 2014-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-15
      • 2013-05-08
      • 2010-12-05
      • 2010-11-10
      相关资源
      最近更新 更多