简体   繁体   English

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

[英]How to build this source code? - missing dependency

I need a help how to build this example: http://blogs.oracle.com/arungupta/resource/totd154.zip from this tutorial http://blogs.oracle.com/arungupta/entry/totd_154_dynamic_osgi_services 我需要帮助如何构建这个例子: http://blogs.oracle.com/arungupta/resource/totd154.zip从本教程http://blogs.oracle.com/arungupta/entry/totd_154_dynamic_osgi_services

I installed Netbeans 7.1. 我安装了Netbeans 7.1。 When I click Clean and Build this error occurs: 当我单击“清理并生成”时,会发生此错误:

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

I suppose that I need to add a specific glassfish repository to the maven configuration. 我想我需要向Maven配置中添加特定的glassfish存储库。 Which repository I need? 我需要哪个存储库?

Quoting my comments (sorry I though it will give chance to someone else to answer properly and not on the run): 引用我的评论(对不起,我会给其他人正确回答的机会,而不是在奔跑中):

To answer your question, download.java.net/maven/glassfish should help. 要回答您的问题,download.java.net / maven / glassfish应该会有所帮助。 The configuration lines are, 配置行是

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

Have fun! 玩得开心!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM