首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven在构建初始Jive项目时未能从存储库中找到jive原型

Maven在构建初始Jive项目时未能从存储库中找到jive原型
EN

Stack Overflow用户
提问于 2013-04-11 19:36:03
回答 1查看 2K关注 0票数 1

我试图按照这里指定的说明执行:https://community.jivesoftware.com/docs/DOC-3544

由于某些原因,当我执行以下操作时:

代码语言:javascript
复制
mvn archetype:generate -e -B -DarchetypeGroupId=com.jivesoftware.maven -DarchetypeArtifactId=maven-jive-archetype -DarchetypeVersion=6.0.x-SNAPSHOT -DgroupId=com.jivesoftware.dummycustomer -DartifactId=dummyCustomerSite  

它似乎找不到原型。

我相信我已经向我的~/.m2/setings.xml(即代理设置、概要文件和jive凭据)添加了所需的所有更改。

代码语言:javascript
复制
<?xml version="1.0"?>
<settings>
  <profiles>
    <profile>
        <id>jive.archiva</id>
        <activation>
            <activeByDefault>false</activeByDefault>
        </activation>
        <repositories>
            <repository>
                <id>jive.internal</id>
                <name>Jive's Repository</name>
                <url>https://maven-secure.jivesoftware.com/archiva/repository/jive.internal</url>
            </repository>

            <repository>
                <id>jive.snapshots</id>
                <name>Jive's Repository</name>
                <url>https://maven-secure.jivesoftware.com/archiva/repository/jive.snapshots</url>
            </repository>
        </repositories>

        <pluginRepositories>
            <pluginRepository>
                <id>jive.internal</id>
                <name>Jive's Repository</name>
                <url>https://maven-secure.jivesoftware.com/archiva/repository/jive.internal</url>
            </pluginRepository>

            <pluginRepository>
                <id>jive.snapshots</id>
                <name>Jive's Repository</name>
                <url>https://maven-secure.jivesoftware.com/archiva/repository/jive.snapshots</url>
            </pluginRepository>
        </pluginRepositories>

        <properties>
            <tomcat6.home><![CDATA[/usr/local/apache-tomcat-6.0.36]]></tomcat6.home>
            <cargo.wait>false</cargo.wait>
            <jive.setup>true</jive.setup>
            <jive.devMode>true</jive.devMode>
            <pluginDirs>null</pluginDirs>
        </properties>
    </profile>
</profiles>
<servers>
 <server>
    <id>jive.internal</id>
    <username>john.smith</username>
    <password>password123</password>
 </server>
 <server>
    <id>jive.snapshots</id>
    <username>john.smith</username>
    <password>password123</password>
 </server>
 <server>
    <id>central</id>
    <username>john.smith</username>
    <password>password123</password>
 </server>

代码语言:javascript
复制
   <proxies>
    <proxy>
     <active>true</active>
     <protocol>http</protocol>
     <host>proxy.mycompany.com</host>
     <port>8080</port>
     <nonProxyHosts>*.mycompany.com|localhost</nonProxyHosts>
    </proxy>
   </proxies>
    </settings>

在运行时,Maven说它找不到文件:

代码语言:javascript
复制
$mvn archetype:create -DarchetypeGroupId=com.jivesoftware.maven -DarchetypeArtifactId=maven-jive-archetype -DarchetypeVersion=5.0.x-SNAPSHOT -DgroupId=com.cirrus.jive -DartifactId=tap
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-archetype-plugin:2.2:create (default-cli) @ standalone-pom ---
[WARNING] This goal is deprecated. Please use mvn archetype:generate instead
[INFO] Defaulting package to group ID: com.cirrus.jive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.116s
[INFO] Finished at: Thu Apr 11 16:17:50 CDT 2013
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:create (default-cli) on project standalone-pom: Error creating from archetype: org.apache.maven.archetype.downloader.DownloadNotFoundException: Requested com.jivesoftware.maven:maven-jive-archetype:jar:5.0.x-SNAPSHOT download does not exist. Could not find artifact com.jivesoftware.maven:maven-jive-archetype:jar:5.0.x-SNAPSHOT
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=com.jivesoftware.maven -DartifactId=maven-jive-archetype -Dversion=5.0.x-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=com.jivesoftware.maven -DartifactId=maven-jive-archetype -Dversion=5.0.x-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] 
[ERROR] com.jivesoftware.maven:maven-jive-archetype:jar:5.0.x-SNAPSHOT
[ERROR] 
[ERROR] from the specified remote repositories:
[ERROR] central (http://repo1.maven.org/maven2, releases=true, snapshots=false)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

编辑:在遵循Charlee的建议之后,我得到了这些警告。

代码语言:javascript
复制
[WARNING] Archetype not found in any catalog. Falling back to central repository (http://repo1.maven.org/maven2).
[WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
Downloading: http://repo1.maven.org/maven2/com/jivesoftware/maven/maven-jive-archetype/6.0.x-SNAPSHOT/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/com/jivesoftware/maven/maven-jive-archetype/6.0.x-SNAPSHOT/maven-metadata.xml
...
...
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.245s
[INFO] Finished at: Fri Apr 12 10:03:30 CDT 2013
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------

看起来它仍然找不到原型,然后转到另一个存储库,所以这不是我想要的。如果我将原型版本的参数更改为5.0 (我认为我的公司可能希望我使用该版本)。将DarchetypeVersion=5.0.x-快照设置为以下内容(请注意,其中说xxxx实际上应该说http,因为stackoverflow抱怨我由于声誉不足无法发布html链接):

代码语言:javascript
复制
[WARNING] Archetype not found in any catalog. Falling back to central repository (http://repo1.maven.org/maven2).
[WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
Downloading: xxxx://repo1.maven.org/maven2/com/jivesoftware/maven/maven-jive-archetype/5.0.x-SNAPSHOT/maven-metadata.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.009s
[INFO] Finished at: Fri Apr 12 10:08:44 CDT 2013
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.jivesoftware.maven:maven-jive-archetype:5.0.x-SNAPSHOT) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.jivesoftware.maven:maven-jive-archetype:5.0.x-SNAPSHOT)

对于为什么我找不到5.0.x快照,有什么建议吗?

EN

回答 1

Stack Overflow用户

发布于 2013-04-12 02:28:12

因为名为jive.archiva的配置文件在默认情况下不是活动的。AFAIK有以下两种可能的方法:

1.通过指定配置文件id来执行maven。

代码语言:javascript
复制
mvn archetype:generate -e -B 
   -P jive.archiva 
   -DarchetypeGroupId=com.jivesoftware.maven 
   -DarchetypeArtifactId=maven-jive-archetype 
   -DarchetypeVersion=6.0.x-SNAPSHOT 
   -DgroupId=com.jivesoftware.dummycustomer 
   -DartifactId=dummyCustomerSite  

2.通过缺少系统属性使配置文件活动起来。

代码语言:javascript
复制
<profiles>
    <profile>
        <id>jive.archiva</id>
        <activation>
            <activeByDefault>false</activeByDefault>
            <property>
               <name>!disableJive</name>
            </property>
        </activation>
    </profile>
</profile>

您可能想知道为什么我们不使用<activeByDefault>true</activeByDefault>。也许这就是答案

此配置文件将自动用于所有构建,除非在同一中的另一个配置文件是使用前面描述的方法之一激活的。默认情况下,所有活动的配置文件都是在命令行或其激活配置中激活配置文件时,自动停用的

请参阅构建概要文件简介的更多信息。

我希望这能帮上忙。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15957358

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档