编写WSO2连接器:从原型创建Maven项目模板不起作用

时间:2017-03-09 13:34:52

标签: maven wso2 maven-2 maven-3 wso2esb

我在docs.wso2.com上尝试了这个tutorial,但是步骤从原型创建Maven项目模板

mvn archetype:generate -DarchetypeGroupId=org.wso2.carbon.extension.archetype -DarchetypeArtifactId=org.wso2.carbon.extension.esb.connector-archetype -DarchetypeVersion=2.0.0 -DgroupId=org.wso2.carbon.connector -DartifactId=org.wso2.carbon.connector.helloworld -Dversion=1.0.0 -DarchetypeRepository=http://maven.wso2.org/nexus/content/repositories/wso2-public/

失败并显示错误:

...
    [INFO] Generating project in Interactive mode
    [WARNING] Archetype not found in any catalog. Falling back to central repository (http://repo.maven.apache.org/maven2).
    [WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
    Downloading: http://repo.maven.apache.org/maven2/org/wso2/carbon/extension/archetype/org.wso2.carbon.extension.esb.connector-archetype/2.0.0/org.wso2.carbon.ext
    ension.esb.connector-archetype-2.0.0.pom
    [WARNING] The POM for org.wso2.carbon.extension.archetype:org.wso2.carbon.extension.esb.connector-archetype:jar:2.0.0 is missing, no dependency information avai
    lable
    Downloading: http://repo.maven.apache.org/maven2/org/wso2/carbon/extension/archetype/org.wso2.carbon.extension.esb.connector-archetype/2.0.0/org.wso2.carbon.ext
    ension.esb.connector-archetype-2.0.0.jar
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5.055 s
    [INFO] Finished at: 2017-03-09T11:34:17+01:00
    [INFO] Final Memory: 16M/218M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.0:generate (default-cli) on project standalone-pom: The desired archetype doe
    s not exist (org.wso2.carbon.extension.archetype:org.wso2.carbon.extension.esb.connector-archetype:2.0.0) -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.0:generate (default-cli) on p
    roject standalone-pom: The desired archetype does not exist (org.wso2.carbon.extension.archetype:org.wso2.carbon.extension.esb.connector-archetype:2.0.0)

文档不好或我的错误?
有一个原型开始编写自定义Java连接器吗?

3 个答案:

答案 0 :(得分:1)

在错误消息中,它显示为&#34; http://repo.maven.apache.org/maven2&#34;。你可以检查maven版本,如果它不是maven2,安装maven2然后尝试该原型。

答案 1 :(得分:0)

检查您当地的maven仓库中是否有:

[MAVEN_REPO]\org\wso2\carbon\extension\archetype\org.wso2.carbon.extension.esb.connector-archetype\2.0.0\org.wso2.carbon.extension.esb.connector-archetype-2.0.0.jar

[MAVEN_REPO]\org\wso2\carbon\extension\archetype\org.wso2.carbon.extension.esb.connector-archetype\2.0.0\org.wso2.carbon.extension.esb.connector-archetype-2.0.0.pom

最后再次使用-e并删除

中的所有内容
[MAVEN_REPO]\org\wso2\carbon\extension\archetype\org.wso2.carbon.extension.esb.connector-archetype\2.0.0\

答案 2 :(得分:0)

转到https://github.com/wso2-extensions/archetypes并克隆    您有兴趣构建的原型项目。

如果mvn create命令失败,请使用pom创建一个java项目    在原型项目中可用。

对pom中不同工件的版本进行更正    在wso2 maven存储库中可用。