Maven Ant Tasks
  1. Maven Ant Tasks
  2. MANTTASKS-11

antlib + http based repository + version range errors badly

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 2.0.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      maven 2.0 (release), antlib, ant, apache 2 webserver on windows
    • Number of attachments :
      0

      Description

      In my pom file, I have a dependency, it has no child dependencies beyond that looks like this:

      <dependency>
      <groupId>org.sporty</groupId>
      <artifactId>xwork</artifactId>
      <version>[1.0.5,1.1)</version>
      <scope>runtime</scope>
      </dependency>

      and use the following in my build script:

      <artifact:dependencies verbose="true" useScope="runtime" pathId="project.classpath.runtime">
      <artifact:pom file="pom.xml" />
      <artifact:remoteRepository url="$

      {project.repository}

      " layout="default" />
      </artifact:dependencies>

      The variable I have above is being set right per tests 1-3. The last test.. it gets strange.

      I deployed xwork, as an empty jar by accident, so don't be surprised there's nothing in the jar. But the dependency downloading from the webserver breaks horribly. I tested 4 scenarios:

      1. If I put in my pom as my remote repository as file://c:/temp/repository and deploy to there, the above pom works flawlessly.

      2 & 3. If I replace the range w/ a simple: <version>1.0.5</version> and set my repository to http://sporty.org/java/repository, it downloads fine as well. It works with the filesystem remote repository of my c:/temp... directory.

      4. If I use the http repository AND use a range version as I originally wanted, I get an ugly error:

      C:\development\eclipse 3.0\workspace\hibernate-3\common.xml:4: Unable to resolve
      artifact: Unable to get dependency information: Unable to read local copy of me
      tadata: Cannot read metadata from 'C:\Documents and Settings\sportee\.m2\reposit
      ory\org\sporty\xwork\maven-metadata-remote.xml': end tag name </pre> must match
      start tag name <hr> from line 11 (position: START_TAG seen ...</a>
      11-Oct-2005 17:52 - \n<hr></pre>... @11:11)
      org.sporty:xwork:null:jar

      from the specified remote repositories:
      remote (http://sporty.org/java/repository )
      Path to dependency:
      1) org.sporty:xdoclet-xwork:jar:1.0-SNAPSHOT

      The contents of the ...-remote.xml file, I see a directory listing, and not the contents of the repository file on the server. My naive guess is the repository file to look for is getting lost, or not passed, if it's in a hashmap, not being referenced properly...

      Thanks,
      -s

        Activity

        Hide
        Brett Porter added a comment -

        looks like it attempted to parse a 404 or something. is it possible that requesting that maven-metadata.xml file on your server returns a page that contains HTML but has a code of 200?

        Either way, we should check of text/html as a mime type and fail even if it is 200, unless we were requesting text/html explicitly to avoid these errors

        Show
        Brett Porter added a comment - looks like it attempted to parse a 404 or something. is it possible that requesting that maven-metadata.xml file on your server returns a page that contains HTML but has a code of 200? Either way, we should check of text/html as a mime type and fail even if it is 200, unless we were requesting text/html explicitly to avoid these errors
        Hide
        spencer portee added a comment -

        It's not a 404 page, but a 200 where the contents are a directory listing rendered as HTML. The date in the bug above, in that html, is the date I uploaded something to my local repository.

        Regarding the original bug, setting the repository to file:// and deploying there, clearing out my local repository, and then trying to resolve dependencies doesn't work. I would expect antlib to say, "hey, the dependencies aren't in the local, let me copy them", but I get the output below. Note, when a version doesn't exist, I get the version numbers i requested and those that exist. This is NOT the case below, but something broken in maven2. It's clear it can't find any version at all.


        [INFO] artifact org.sporty:log4j: checking for updates from remote
        [artifact:dependencies] An error has occurred while processing the Maven artifac
        t tasks.
        [artifact:dependencies] Diagnosis:
        [artifact:dependencies]
        [artifact:dependencies] Unable to resolve artifact: No versions are present in t
        he repository for the artifact with a range [1.2.0,1.3.0)
        [artifact:dependencies] org.sporty:log4j:null:jar
        [artifact:dependencies]
        [artifact:dependencies] from the specified remote repositories:
        [artifact:dependencies] remote (file://c:/developmnet/repository )
        [artifact:dependencies]
        [artifact:dependencies]

        BUILD FAILED
        C:\development\eclipse 3.0\workspace\hibernate-3\sub-projects\flip\build.xml:4:
        The following error occurred while executing this line:
        C:\development\eclipse 3.0\workspace\hibernate-3\common.xml:4: Unable to resolve
        artifact: No versions are present in the repository for the artifact with a ran
        ge [1.2.0,1.3.0)
        org.sporty:log4j:null:jar

        here's the maven-metadata.xml file in the log4j directory in my file:// remote repository...


        <metadata>
        <groupId>org.sporty</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.12</version>
        <versioning>
        <versions>
        <version>1.2.12</version>
        </versions>
        <lastUpdated>20051021192921</lastUpdated>
        </versioning>
        </metadata

        antlib is severely borked.

        Show
        spencer portee added a comment - It's not a 404 page, but a 200 where the contents are a directory listing rendered as HTML. The date in the bug above, in that html, is the date I uploaded something to my local repository. Regarding the original bug, setting the repository to file:// and deploying there, clearing out my local repository, and then trying to resolve dependencies doesn't work. I would expect antlib to say, "hey, the dependencies aren't in the local, let me copy them", but I get the output below. Note, when a version doesn't exist, I get the version numbers i requested and those that exist. This is NOT the case below, but something broken in maven2. It's clear it can't find any version at all. [INFO] artifact org.sporty:log4j: checking for updates from remote [artifact:dependencies] An error has occurred while processing the Maven artifac t tasks. [artifact:dependencies] Diagnosis: [artifact:dependencies] [artifact:dependencies] Unable to resolve artifact: No versions are present in t he repository for the artifact with a range [1.2.0,1.3.0) [artifact:dependencies] org.sporty:log4j:null:jar [artifact:dependencies] [artifact:dependencies] from the specified remote repositories: [artifact:dependencies] remote ( file://c:/developmnet/repository ) [artifact:dependencies] [artifact:dependencies] BUILD FAILED C:\development\eclipse 3.0\workspace\hibernate-3\sub-projects\flip\build.xml:4: The following error occurred while executing this line: C:\development\eclipse 3.0\workspace\hibernate-3\common.xml:4: Unable to resolve artifact: No versions are present in the repository for the artifact with a ran ge [1.2.0,1.3.0) org.sporty:log4j:null:jar — here's the maven-metadata.xml file in the log4j directory in my file:// remote repository... – <metadata> <groupId>org.sporty</groupId> <artifactId>log4j</artifactId> <version>1.2.12</version> <versioning> <versions> <version>1.2.12</version> </versions> <lastUpdated>20051021192921</lastUpdated> </versioning> </metadata – antlib is severely borked.
        Hide
        Brett Porter added a comment -

        I don't understand how it can get the directory listing when requesting the metadata file.

        Can you please upload a zip of a project that exhibits this behaviour?

        Show
        Brett Porter added a comment - I don't understand how it can get the directory listing when requesting the metadata file. Can you please upload a zip of a project that exhibits this behaviour?
        Hide
        spencer portee added a comment -

        That's the rub. It doesn't request the metadata file. It requests a url representing a directory instead, thinking it's looking for the file.

        Show
        spencer portee added a comment - That's the rub. It doesn't request the metadata file. It requests a url representing a directory instead, thinking it's looking for the file.
        Hide
        Herve Boutemy added a comment -

        I just tried to add <dependency groupId="org.apache.maven" artifactId="maven-artifact" version="[2.0,2.1)"/> to test-deps target in sample.build.xml, and found everything ok (Maven Ant Tasks version is 2.0.7-SNAPSHOT)

        Please reopen the issue if you still have a problem: we'll work together to reproduce it.

        Show
        Herve Boutemy added a comment - I just tried to add <dependency groupId="org.apache.maven" artifactId="maven-artifact" version="[2.0,2.1)"/> to test-deps target in sample.build.xml, and found everything ok (Maven Ant Tasks version is 2.0.7-SNAPSHOT) Please reopen the issue if you still have a problem: we'll work together to reproduce it.

          People

          • Assignee:
            Unassigned
            Reporter:
            spencer portee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: