【问题标题】:Restlet Maven DependenciesRestlet Maven 依赖项
【发布时间】:2012-06-23 23:15:37
【问题描述】:

有谁知道 RESTLET maven 依赖项是什么?

网站上的所有条目均无效。我最终不得不安装 jars 才能让它工作。

【问题讨论】:

  • 他们可能不会将工件上传到 repo1。您是否尝试过按照restlet.org/downloads/maven 将他们的存储库添加到您的 POM 中?

标签: maven restlet


【解决方案1】:

添加这个仓库:

<repositories>
    <repository>
        <id>maven-restlet</id>
        <name>Public online Restlet repository</name>
        <url>https://maven.restlet.talend.com/</url>
    </repository>
</repositories>

然后在您的版本中包含依赖项:

<dependency>
        <groupId>org.restlet.jee</groupId>
        <artifactId>org.restlet</artifactId>
        <version>${restlet.version}</version>
</dependency>

用途:

<properties>
    <restlet.version>2.0.14</restlet.version>
</properties>

定义 restlet 版本或只是放置您喜欢的任何版本。希望对您有所帮助!

【讨论】:

  • 即使我在 pom.xml 中声明了 repo,我仍然有缺少工件异常。
  • 遇到了完全相同的问题,但没有解决。也最终没有使用 Maven 依赖项并嵌入 .jar 文件。我应该提到我还进行了清理,使用了 Eclipse m2e 和命令行,并且我正在并行地在 Windows VM 中工作,如果这能解释更多的话。此外,我可以轻松地访问 Maven 应该从我的浏览器中找到的网络资源,并且所有其他工件都可以毫无问题地找到并下载。我想这是一个罕见的问题,但它打击了我并且没有解决。
  • 仅供参考:Windows 更新并重新启动后,一切正常。我猜这是 Maven 中难以重现的错误。
【解决方案2】:

有时,maven 依赖项不会自动下载。您必须使用 mvn compile 强制它。

这是对使用以下依赖项的示例 RESTful 服务的参考:

http://topjavatutorial.com/frameworks/spring/spring-rest/standalone-restful-service-using-restlet-framework/

    <dependency>
        <groupId>org.restlet.jse</groupId>
        <artifactId>org.restlet</artifactId>
        <version>2.1-RC2</version>
    </dependency>
    <dependency>
        <groupId>org.restlet.jse</groupId>
        <artifactId>org.restlet.ext.simple</artifactId>
        <version>2.1-RC2</version>
    </dependency>

【讨论】:

    【解决方案3】:

    this中使用给定的镜像

    这些镜像是最新的,所以不用担心版本等等。

    在maven安装位置编辑settings.xml添加镜像。

    <settings>
      <mirrors>
         <mirror>
           <id>mygrid-restlet</id>
           <url>http://www.mygrid.org.uk/maven/restlet/maven.restlet.org</url>
           <mirrorOf>maven-restlet</mirrorOf>
         </mirror>
      </mirrors>
     </settings>
    

    假设使用原始存储库的 POM 使用:

    <repository>
       <id>maven-restlet</id>
       <name>Public online Restlet repository</name>
       <url>http://maven.restlet.org</url>
    </repository>
    

    【讨论】:

      【解决方案4】:
      <!-- https://mvnrepository.com/artifact/com.softlayer.api/softlayer-api-client -->
      <dependency>
          <groupId>com.softlayer.api</groupId>
          <artifactId>softlayer-api-client</artifactId>
          <version>0.1.0</version>
      </dependency>
      

      【讨论】:

        猜你喜欢
        • 2021-12-06
        • 1970-01-01
        • 1970-01-01
        • 2018-10-20
        • 2016-05-29
        • 1970-01-01
        • 1970-01-01
        • 2016-05-24
        • 2012-11-18
        相关资源
        最近更新 更多