Jump to content
We've recently updated our Privacy Statement, available here ×

Serious problem with maven repository


cn73

Recommended Posts

Since this morning I have a very serious problem, from pom file http://repo2.maven.org/maven2/jasperreports/jasperreports/3.0.0/jasperreports-3.0.0.pom I read that you put your repository:

 

<repositories>

<repository>
<id>jaspersoft</id>
<url>http://www.jasperforge.org/maven2</url>
</repository>
</repositories>

when I compile my project, it creates a file maven-metadata-jaspersoft.xml directory under the commons-collections ... it should includes this file:

 

<? Xml version = "1.0" encoding = "UTF-8"?>
<metadata>
  
<groupId> commons-collections </ groupId>
  
<artifactId> commons-collections </ artifactId>
</ Metadata>

instead contains a standard error page (see attachment)... I believe in your repository, there are no more 'common-collections and other dependencies?

please, it blocks the build!

 

Link to comment
Share on other sites

  • Replies 14
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

I'm a bit confused about this, because I don't think we ever had Apache Commons dependencies in our JasperForge.org repository.

These dependencies always existed in public Maven repositories, so there was no reason for us to publish in our own.

In our forge-based repository, we've only put dependencies that were not available on public Maven repos.

 

Are you sure you point to public Maven repos in your settings.xml?

You can see Commons Collections here:

http://repo1.maven.org/maven2/commons-collections/commons-collections/

 

I hope this helps.
Teodor

 

Link to comment
Share on other sites

Yes i'm sure... for every repository, maven create a file named:

maven-metadata-idrepository.xml,

eg: maven-metadata-jaspersoft.xml, maven-metadata-maven2.dev.java.net....in  in .m2/repository/commons-collections/commons-collections/

 

the maven-metadata-jaspersoft.xm that is created is in my attachment!

This cause build fails... So my workaround is put in settings.xml the mirror:

 

<mirrors>

    <mirror>

          <id>my-repository</id>

            <url>http://myrep_url/</url>

            <mirrorOf>jaspersoft</mirrorOf>

      </mirror>

</mirrors>

Link to comment
Share on other sites

Hello, i have the same problem here since yesterday too. Thx for the tips on the settings.xml.

Since i don't remember whether these dependencies were on the JasperForge repo or not my guess is that since the site has gone under some maintenance the 30th of October could it be that what was a 404 HTTP error code before is now a 202 HTTP code with an error page rendering ? In this case, it can be that maven generates a basic maven-metadata-jaspersoft.xml instead...

I myself opened a thread this morning at maven mailing. For those interested, see http://www.mail-archive.com/users@maven.apache.org/msg113796.html



Post Edited by ctrung at 11/02/2010 17:06
Link to comment
Share on other sites

you can edit your ${user.home}/.m2/settings.xml file and

1)Disable jaspersoft repository creating a profile like this:

 <profiles>
    <profile>
       <id>default</id>
       <activation>
             <activeByDefault>true</activeByDefault>
       </activation>
       <repositories>
            <repository>
                <id>jaspersoft</id>
                <name>Jasper Soft</name>
                <url>http://jasperforge.org/maven2/</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>
    </profile>
</profiles>
     

2)use a mirror instead...see http://maven.apache.org/guides/mini/guide-mirror-settings.html



Post Edited by cn73 at 03/11/2010 08:36
Link to comment
Share on other sites

I used this, but received this error:

 

add-jdbc-driver:

[exec] Error reading settings.xml: Expected root element 'settings' but found 'profiles' (position: START_TAG seen <profiles>... @1:10)

[exec] Line: 1

[exec] Column: 10

 

BUILD FAILED

/home/jhelfman/jasperserver/work/jasperserver-3.5.0-src/jasperserver/buildomatic/dev.xml:35: exec returned: 1

 

Link to comment
Share on other sites

The problem isn't that Jasperforge mistakenly contains Apache Commons artifacts, as Teodor suspected. The problem is this:

  1. Maven asks Jasperforge for http://jasperforge.org/maven2/commons-lang/commons-lang/2.5/commons-lang-2.5.pom
  2. Jasperforge responds with "302 Found", redirecting you to /404.php
  3. Maven assumes that the file must have been moved to http://jasperforge.org/404.php so it downloads /404.php
  4. Jasperforge replies with 404.php, but it gives it a "200 OK" status code. 
  5. Maven interprets the 200 status code to mean it worked. So it tries to read it as a pom file but fails because it is actually HTML.
I use Nexus to proxy all of my Maven repositories, and I order it so that Maven central is checked before Jasperforge. This eliminates the commons-lang problem I describe, but it doesn't actually fix my problem. That is because if any of my Maven builds requests an artifact that doesn't exist, here is what happens:
  1. My maven build asks my Nexus server for .../bogus/bogus/1.0/bogus-1.0.pom
  2. Nexus doesn't have that artifact, so it asks Maven central for http://repo1.maven.org/maven2/bogus/bogus/1.0/bogus-1.0.pom
  3. Maven central responds with the "404 Not Found" status code. 
  4. Nexus understands that Maven central doesn't have the requested artifact, so next it
  5. checks Jasperforge for http://jasperforge.org/maven2/bogus/bogus/1.0/bogus-1.0.pom
  6. Jasperforge responds with the "302 Found", redirecting to /404.php, which responds with "200 OK"
  7. Nexus thinks it found the bogus pom file because Jasperforge responded with "200 OK", so it responds back to my maven build with the content of 404.php
  8. Maven tries to load that file, but can't because it is actually HTML, not a pom file
Even if I fix my build so it doesn't request bogus artifacts, I can still run into problems when some artifacts use version ranges. In that case, Maven/Nexus will always check both Maven central and Jasperforge for the list of versions available. Jasperforge will respond with HTML instead of the metadata file that contains the list of available version numbers. Again, Nexus/Maven won't be able to parse that file because it is HTML from 404.php.
 
We need Jasperforge to respond with a real 404 status code instead of a 404.php page with a 200 status code when a resource is not found.
Link to comment
Share on other sites

  • 11 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...