- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试 Maven in 5 Minutes教程并几乎立即遇到错误。 mvn --version
的结果是
Apache Maven 3.5.2
Maven home: /usr/share/maven
Java version: 1.8.0_171, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-23-generic", arch: "amd64", family: "unix"
当我运行教程中的下一个命令时,
$ mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app \
-DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
我收到以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli)
on project standalone-pom: archetypeCatalog 'http://mavenrepo.openmrs.org/nexus/content/repositories/public/archetype-catalog.xml'
is not supported anymore. Please read the plugin documentation for details. -> [Help 1]
“帮助 1”就是 docs for MojoFailureException .
似乎 archetype 插件发布了重大更改,而 Maven 教程尚未更新以反射(reflect)这一点。虽然,有趣的是,docs for the Quickstart Archetype 建议的命令,
$ mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.3
同样的错误也失败了。
是否仍然可以基于 Quickstart 原型(prototype)生成 Maven 项目,如果可以,我该怎么做?
编辑:这是我的 ~/.m2/settings.xml
文件:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>${env.BINTRAY_USER}</username>
<password>${env.BINTRAY_API_KEY}</password>
<id>bintray-sdk</id>
</server>
</servers>
<profiles>
<profile>
<properties>
<archetypeRepository>http://mavenrepo.openmrs.org/nexus/content/repositories/public</archetypeRepository>
<archetypeCatalog>http://mavenrepo.openmrs.org/nexus/content/repositories/public/archetype-catalog.xml</archetypeCatalog>
</properties>
<repositories>
<repository>
<id>openmrs-repo</id>
<name>OpenMRS Nexus Repository</name>
<url>http://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
</repository>
<repository>
<id>openmrs-repo-thirdparty</id>
<name>OpenMRS Thirdparty Nexus Repository</name>
<url>http://mavenrepo.openmrs.org/nexus/content/repositories/thirdparty</url>
</repository>
<repository>
<id>openmrs-bintray-repo</id>
<name>OpeMRS Maven Bintray Repository</name>
<url>https://dl.bintray.com/openmrs/maven/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>openmrs-repo</id>
<name>OpenMRS Nexus Repository</name>
<url>http://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
</pluginRepository>
<pluginRepository>
<id>openmrs-bintray-repo</id>
<name>OpeMRS Maven Bintray Repository</name>
<url>https://dl.bintray.com/openmrs/maven/</url>
</pluginRepository>
</pluginRepositories>
<id>openmrs</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>openmrs</activeProfile>
</activeProfiles>
<pluginGroups>
<pluginGroup>org.openmrs.maven.plugins</pluginGroup>
</pluginGroups>
</settings>
最佳答案
实际上,正如错误消息所暗示的那样,不推荐使用 archetypeCatalog
。您必须从 settings.xml
中删除属性 archetypeRepository
和 archetypeCatalog
,并将 archetype
声明为 id
,像这样:
<settings>
<profile>
<id>openmrs</id>
<repositories>
<repository>
<id>archetype</id>
<url>http://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
</repository>
<!-- keep other repositories -->
</repositories>
</profile>
</settings>
您的 Activity 配置文件是 openmrs
,因此应该使用此配置找到原型(prototype),因为它们存在于 openmrs
存储库中(参见 https://mavenrepo.openmrs.org/nexus/content/repositories/public/org/apache/maven/archetypes/)。
关于java - "Maven in 5 Minutes"教程中的原型(prototype)插件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51333580/
好吧,我怀疑这是一个独特的情况,所以要么有人这样做了,要么有人认为这是不可能的,至少以我所要求的方式。 我有 2 个原型(prototype)变量(函数),一个是父变量,另一个是助手。我想做的是从助手
这是 JavaScript 大师的问题。我正在尝试更优雅地使用 JavaScript 原型(prototype)模型。这是我的实用程序代码(它提供了真实的原型(prototype)链并正确使用 ins
我们知道在 JavaScript 中有一个用于数组的 .forEach() 方法。但是字符串没有内置该方法。 那么,下面的代码片段有没有问题:String.prototype.forEach = Ar
我们知道在 JavaScript 中有一个用于数组的 .forEach() 方法。但是字符串没有内置该方法。 那么,下面的代码片段有没有问题:String.prototype.forEach = Ar
我看到了两种不同的模式和解释。来自 DailyJS 和许多其他人的一篇:矩形.prototype = new Shape(); 然后是 Crockford 的 here 这意味着只是 矩形.proto
尝试在 Object.prototype 以及 String.prototype 和 Number.prototype 上定义一个 hashCode 方法>。我正在使用以下方法定义原型(prototy
在本教程中,您将借助示例了解 JavaScript 中的原型。 在学习原型之前,请务必查看以下教程: JavaScript 对象 JavaScript 构造函数 如您所知,您可以使用对象构造函
当构造新对象时,该对象被设置为委托(delegate)任何尚未显式设置为其构造函数原型(prototype)的属性。这意味着我们可以稍后更改原型(prototype),并且仍然可以看到实例中的更改。
我正在努力获得更好的 JavaScript 实用知识。所以,我买了 Douglas Crockford 的书“JavaScript the good parts”。 我现在很难掌握原型(prototy
我的理解是相同类型的所有对象将共享相同的原型(prototype)。因此对原型(prototype)的更改将反射(reflect)在每个对象上。但是值类型的属性似乎不是这样。这种属性是如何存储的? f
这个问题在这里已经有了答案: 关闭 12 年前。 Possible Duplicate: JavaScript: Class.method vs. Class.prototype.method 创建
为什么在 MDN 函数中 polyfills 使用“if (!Array.prototype.filter)”? if (!Array.prototype.filter) { Array.prot
这个问题已经有答案了: Assigning prototype methods *inside* the constructor function - why not? (6 个回答) 已关闭 7 年
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 9 年前。 Improve this qu
面向对象有一个特征是继承,即重用某个已有类的代码,在其基础上建立新的类,而无需重新编写对应的属性和方法,继承之后拿来即用; 。 在其他的面向对象编程语言比如Java中,通常是指,子类继承父类的属性和
OOP 中原型(prototype)设计模式最重要的部分之一是我们不会从头开始创建新对象,我们只是使用 clone() 函数从现有对象克隆它们。 那么clone()函数是深拷贝还是浅拷贝? 如果它是一
在进行原型(prototype)设计时,您在多大程度上放弃了最佳实践来支持代码和修复黑客攻击?当然,代码并不打算在完整的生产环境中保留。 补充:我正在研究一个用 Python 制作的相当大的半工作原型
我开始学习设计模式。我知道原型(prototype)是用来制作我已经拥有的对象的精确副本,而享元是用来制作类似的对象。 我已经编写了 2D 平台游戏,例如马里奥(Java)。有很多相同的敌人,唯一的区
我正在使用 Maven 生成原型(prototype)。我能够使原型(prototype)生成正常,并且它生成的项目模板按预期工作。唯一的问题是在我的 shell 脚本中。脚本中注释掉的任何内容都会被
我想用 primefaces 配置一个 Java EE 项目。我在某处读到可以使用 mvn arechetype:generate 创建项目结构。当我使用它时,我只看到了 41 个选项,而在该教程中,
我是一名优秀的程序员,十分优秀!