如何构建此源代码? - 缺少依赖性

时间:2012-01-09 14:29:39

标签: java netbeans maven

我需要帮助如何构建此示例: http://blogs.oracle.com/arungupta/resource/totd154.zip 从本教程 http://blogs.oracle.com/arungupta/entry/totd_154_dynamic_osgi_services

我安装了Netbeans 7.1。当我单击清除并生成此错误时:

Failed to execute goal on project helloworld-cdiclient: Could not resolve dependencies for project org.samples.osgi.helloworld:helloworld-cdiclient:war:1.0-SNAPSHOT: Could not find artifact org.glassfish:osgi-cdi-api:jar:3.1-SNAPSHOT -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

After correcting the problems, you can resume the build with the command
  mvn <goals> -rf :helloworld-cdiclient

我想我需要在maven配置中添加特定的glassfish存储库。我需要哪个存储库?

1 个答案:

答案 0 :(得分:1)

引用我的评论(对不起,虽然它会让其他人有机会正确回答而不是在跑步中):

要回答您的问题,download.java.net/maven/glassfish应该会有所帮助。配置行是,

<repositories>
    <repository>
        <id>glassfish-repo</id>
        <name>The Glassfish repository</name>
        <url>http://download.java.net/maven/glassfish/</url>
    </repository>
    <!-- all the rest... -->
</repositories>

玩得开心!