无法从wadl

时间:2015-08-25 12:10:48

标签: rest maven wadl

错误:

'[ERROR] No plugin found for prefix 'wadl' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories'

何时:我正在尝试通过参考“Maven Plug-in Usage”部分中的以下链接来生成java文件

https://wadl.java.net/wadl2java.html

2 个答案:

答案 0 :(得分:0)

您能否确保您的pom.xml具有以下存储库,插件存储库和依赖项?

  <repositories>
    <repository>
      <id>wadl-repository</id>
      <name>WADL Maven Repository</name>
      <url>https://wadl.dev.java.net/nonav/repository/</url>
    </repository>
    <repository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Repository for Maven</name>
      <url>http://download.java.net/maven/2/</url>
    </repository>
    <repository>
      <id>wadl-snapshots</id>
      <name>WADL Snapshots Repository</name>
      <url>https://wadl.dev.java.net/nonav/snapshots</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>wadl-snapshots</id>
      <name>WADL Snapshots Repository</name>
      <url>https://wadl.dev.java.net/nonav/snapshots</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </pluginRepository>
  </pluginRepositories>
  <dependencies>
    <dependency>
      <groupId>org.jvnet.ws.wadl</groupId>
      <artifactId>wadl-core</artifactId>
      <version>1.1.6</version>
    </dependency>
  </dependencies>

答案 1 :(得分:0)

我有同样的问题。对我来说问题是因为为了让Maven解析wadl前缀,您需要将插件组添加到settings.xml

  <pluginGroups>
    <pluginGroup>org.jvnet.ws.wadl</pluginGroup>
  </pluginGroups>

这意味着当您运行wadl:generate命令时,它还会在org.jvnet.ws.wadl组中查找匹配项。