gpt4 book ai didi

ruby - 为什么 Buildr 失败了?

转载 作者:太空宇宙 更新时间:2023-11-03 16:35:29 24 4
gpt4 key购买 nike

我的 pom.xml 中有这个:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.aaa</groupId>
<artifactId>bbb</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<name>Xxx</name>

<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.jboss.aop</groupId>
<artifactId>jboss-aop</artifactId>
<version>2.1.8.GA</version>
</dependency>
</dependencies>

</project>

运行 buildr 结果如下:

$ buildr -v compile
/usr/local/lib64/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake/alt_system.rb:32: Use RbConfig instead of obsolete and deprecated Config.
/usr/lib64/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
To use Buildr you need a buildfile. Do you want me to create one?:
1. From Maven2 POM file
2. From directory structure
3. Cancel
? 1
Downloading org.jboss.aop:jboss-aop:pom:2.1.8.GA
Buildr aborted!
URI::InvalidURIError : bad URI(is not URI?): ["https://repository.jboss.org/nexus/content/groups/public-jboss/"]

那显然是因为URI.parse无法解析String ["https://repository.jboss.org/nexus/content/groups/public-jboss/"] 因为它包含方括号和双引号。

有什么办法可以解决吗?

版本是:

$ ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

$ buildr --version
/usr/local/lib64/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake/alt_system.rb:32: Use RbConfig instead of obsolete and deprecated Config.
/usr/lib64/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
Buildr 1.4.6

最佳答案

您可以发布整个 POM 吗?我打赌你能在别处找到 jar 。

如果非要我猜的话,我会说传递依赖依赖于 JBoss 存储库中的 Artifact 。 JBoss 为各种 Java API 提供了大量洁净室 jar。我敢打赌,您的传递依赖项之一是为此目的使用 JBoss jar。

编辑:为了彻底,在您的 Ruby 代码中,您是否使用 jboss-aop jar 中的类?

此外,Maven 允许我将 URL 放入 CData...试试这个:

<url><![CDATA[https://repository.jboss.org/nexus/content/groups/public-jboss]]></url>

此外,尝试禁用 https:

<url><![CDATA[http://repository.jboss.org/nexus/content/groups/public-jboss]]></url>
<url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>

编辑 #2:另一种解决方法,尝试将 JBoss 作为 Repo 添加到您的 ~/.m2/settings.xml 文件中并将其从您的项目 pom 中删除:

<?xml version="1.0" encoding="UTF-8"?>
<settings
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>myprofile</id>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>myprofile</activeProfile>
</activeProfiles>

</settings>

关于ruby - 为什么 Buildr 失败了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8363375/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com