经过两个小时的努力,我完全迷失了方向。
对于我的项目,我需要声明(http://enunciate.codehaus.org/)来为应用程序的RESTFul api生成文档。以前使用maven的1.28版本的插件非常好,但是突然间,我在执行maven目标时遇到了插件中的NullPointerException (但这个例外是另一个需要解决的问题。)
无论如何,我看到了1.29的更新,所以我想我试一试。
在您的maven构建过程中阐明的正常配置基本上如下:
<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-plugin</artifactId>
<version>1.29</version>
<executions>
<execution>
<goals>
<goal>docs</goal>
</goals>
<configuration>
<docsDir>${project.build.directory}/docs</docsDir>
<configFile>enunciate.xml</configFile>
</configuration>
</execution>
</executions>
</plugin>遗憾的是,1.29目前似乎还没有出现在maven central中,但是添加了一个手动依赖和存储库,如下所示:
<repositories>
<repository>
<id>opencast-public</id>
<url>http://repository.opencastproject.org/nexus/content/repositories/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-plugin</artifactId>
<version>1.29</version>
<scope>compile</scope>
</dependency>
</dependencies>实际上,将1.29下载到本地的m2-repo (我可以看到所有的文件.)。无论如何,当我尝试使用上面提到的插件时,maven不会正确执行,但会退出:
插件org.codehaus.enunciate:maven-enunciate-plugin:1.29或其依赖项无法解决:未能读取org.codehaus.enunciate:maven-enunciate-plugin:jar:1.29:的工件描述符(未能在http://repo.maven.apache.org/maven2中找到org.codehaus.enunciate:maven-enunciate-plugin:pom:1.29 )已缓存在本地存储库中,在中央更新间隔已过或更新被迫->帮助1之前,不会重新尝试解析。
为什么maven不使用正确下载的依赖项??
任何帮助都是非常感谢的,因为我已经浪费了很多时间在那里闲逛。
发布于 2014-06-27 18:54:54
我自己就碰到这个了。您需要确保在pluginRepositories块中添加存储库,而不是存储库块。
<pluginRepositories>
<pluginRepository>
<id>opencast-public</id>
<url>http://repository.opencastproject.org/nexus/content/repositories/public/</url>
</pluginRepository>
</pluginRepositories>https://stackoverflow.com/questions/24270331
复制相似问题