2

I've got this in my 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>

running buildr results in this:

$ 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/"]

That's obviously because URI.parse can't parse String ["https://repository.jboss.org/nexus/content/groups/public-jboss/"] because it contains square brackets and double quotes.

Is there any way to fix that?

Versions are:

$ 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
Oleg Mikheev
  • 17,186
  • 14
  • 73
  • 95
  • I'm not using it, since it failed on the first command that I issued. Do you know any other Ruby build tool compatible with pom.xml format? – Oleg Mikheev Dec 03 '11 at 22:33
  • Oleg, this looks like a bug in Buildr and I think you should bring this up by filing a bug or asking the user list. – Antoine Toulme Dec 09 '11 at 18:26
  • But that's the most basic functionality that one could expect from Buildr, I guess it's the first thing that Buildr is being used for. That is why I thought it was me doing something wrong... will try the user list then, thanks – Oleg Mikheev Dec 10 '11 at 10:29
  • It's actually not very common to use a pom file to generate a Buildfile. You do it once and then keep using the Buildfile. – Antoine Toulme Jan 02 '12 at 08:39
  • did you try the ~/.m2/settings.xml trick? – Jonathan S. Fisher Jan 25 '12 at 16:25
  • yes, I don't know if buildr should look into it, but in my case it doesn't - `RuntimeError : Failed to download com.sun.jdmk:jmxtools:pom:1.2.1, tried the following repositories: http://www.ibiblio.org/maven2/` – Oleg Mikheev Jan 25 '12 at 17:37
  • @exabrial I've created a issue - will see what they say https://issues.apache.org/jira/browse/BUILDR-623 – Oleg Mikheev Jan 25 '12 at 17:40
  • did you remove the url from your pom? if so, dang. – Jonathan S. Fisher Jan 25 '12 at 20:31

1 Answers1

1

Can you post your entire POM? I bet you can locate the jar somewhere else.

If I had to guess, I'm going to say a transitive dependency is relying on an artifact from the JBoss repository. JBoss hosts a lot of clean room jars for various Java APIs. I bet one of your transitive dependencies is using the JBoss jars for this purpose.

EDIT: Just to be thorough, in your Ruby code, are you using classes from the jboss-aop jar?

Also, Maven allows me to put the URL in CData... try this:

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

Also, try disabled https:

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

EDIT #2: Another workaround, try adding JBoss as a Repo in your ~/.m2/settings.xml file and removing it from your project 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>
Jonathan S. Fisher
  • 8,189
  • 6
  • 46
  • 84
  • I've added and updated `pom.xml` to demonstrate the problem. The problem is not with specific dependency but rather the fact that Build tries to parse a String containing square brackets and double quotes as a URI -- which could be a bug – Oleg Mikheev Jan 18 '12 at 09:12
  • Just to be thorough, in your Ruby code, are you using classes from the jboss-aop jar? – Jonathan S. Fisher Jan 18 '12 at 15:38
  • I'm not compiling Ruby code, that's a Java project :) I just wanted to see if Buildr was really a faster drop-in replacement for Maven (as it's being advertised). – Oleg Mikheev Jan 18 '12 at 19:12
  • OH lol. Somehow I read ruby in your description... I really was making things up! Anyway, I'm guessing the CData around the URLs didn't help? – Jonathan S. Fisher Jan 18 '12 at 20:06
  • Unfortunately wrapping URL with CDATA doesn't change anything... Probably it's just a bug that needs to be submitted to Apache – Oleg Mikheev Jan 20 '12 at 12:10
  • Well here's a workaround: if you're willing to give up a little bit of 'reproducibility' in your project. In your ~/.m2/settings.xml file, add JBoss as a repo. – Jonathan S. Fisher Jan 20 '12 at 16:09