java - maven3.3.9 init opendaylight架构时的这个bug是什么?

标签 java maven opendaylight

我正在运行这个:

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype \
-DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ \
-DarchetypeCatalog=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml

我得到了这个错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: archetypeCatalog 'http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml' is not supported anymore. Please read the plugin documentation for details. -> [Help 1]

但我可以在网络上打开此链接(' http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml ')。

删除最后一个选项后:

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype \
-DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/

没有错误,但结果如下所示,不符合预期。

那么如何在maven中使用“-DarchetypeCatalog= http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml”呢?

谢谢~

附加信息:

gateway@gateway-20150605:~/workspace/toaster2$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/local/apache-maven
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.8.0_121/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.16.0-30-generic", arch: "i386", family: "unix"

最佳答案

配置你的settings.xml,如下所示,基本上我添加了ODL存储库。

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">  
    <profiles>
        <profile>
            <id>downloadSources</id>
            <properties>
                <downloadSources>true</downloadSources>
                <downloadJavadocs>true</downloadJavadocs>
            </properties>
        </profile>
        <profile>
            <id>opendaylight-release</id>
            <repositories>
                <repository>
                    <id>opendaylight-mirror</id>
                    <name>opendaylight-mirror</name>
                    <url>http://nexus.opendaylight.org/content/repositories/public/</url>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>opendaylight-mirror</id>
                    <name>opendaylight-mirror</name>
                    <url>http://nexus.opendaylight.org/content/repositories/public/</url>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>

        <profile>
            <id>opendaylight-snapshots</id>
            <repositories>
                <repository>
                    <id>opendaylight-snapshot</id>
                    <name>opendaylight-snapshot</name>
                    <url>http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>opendaylight-snapshot</id>
                    <name>opendaylight-snapshot</name>
                    <url>http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
        <profile>
            <id>maven-central-repo</id>
            <repositories>
                <repository>
                    <id>cetral-repo</id>
                    <name>maven-central-repo</name>
                    <url>http://repo1.maven.org/maven2/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>cetral-repo</id>
                    <name>maven-central-repo</name>
                    <url>http://repo1.maven.org/maven2/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>

    <activeProfiles>
        <!-- <activeProfile>maven-central-repo</activeProfile> -->
        <activeProfile>opendaylight-snapshots</activeProfile>
        <activeProfile>opendaylight-release</activeProfile>
        <activeProfile>downloadSources</activeProfile>
        <activeProfile>maven-central-repo</activeProfile>
    </activeProfiles>
</settings>

在 archetypeCatalog 中,您不提供 URL,您需要提供远程、本地或内部,尽管下面的可选内容是更新的 mvn 命令。检查here有关 archetypeCatalog 参数的更多信息

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeVersion=1.4.0-SNAPSHOT

关于java - maven3.3.9 init opendaylight架构时的这个bug是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43513597/

相关文章:

java - 使用 PropertyUtils.setProperty 时类中没有 setter 方法

android - 在 Android Studio 中生成 Google App Engine 后端时需要 Maven

openstack - 为什么有人会在 OpenStack 云中添加 OpenDaylight Controller ?

java - 如何纠正我的第一个 Spring Boot POM

maven - 为什么Maven SCM插件需要connection/developerConnection?

opendaylight - 杨: How can I include a container from another module?

ubuntu - 无法在用户界面 OpenDaylight 中显示节点

java - 谁调用 describeConstable(),何时调用?

java - 为什么 JaCoCo 看到了我的 JUnit 但忽略了我的 Spock 测试?

java - 无法确定出界异常的位置