[ 
http://jira.codehaus.org/browse/MNG-3078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=169097#action_169097
 ] 

Jeremie BOUSQUET commented on MNG-3078:
---------------------------------------

Having exactly this problem with Maven 2.0.10, trying to use 
org.apache.maven:apache-maven, classifier:bin, version:2.0.10 and packaging 
tar.gz or tar.bz2. Maven used to download it last week, but can't anymore after 
deleting from my local repository. I checked in repository central existence of 
these different packages.
I'm using archiva as repository manager, proxifying maven central. All other 
dependencies download well.
Changing packaging to zip unblocks the situation ...

Dependency declared in my pom in <dependencies> :
{noformat}
                <dependency>
                        <groupId>org.apache.maven</groupId>
                        <artifactId>apache-maven</artifactId>
                        <version>2.0.10</version>
                        <type>tar.gz</type>
                        <classifier>bin</classifier>
                        <scope>compile</scope>
                </dependency>
{noformat}

... And used in my assembly in <dependencySets>  :
{noformat}
                <dependencySet>
                        <unpack>true</unpack>
                        <unpackOptions>
                                <excludes>
                                        <exclude>**/settings.xml</exclude>
                                </excludes>
                        </unpackOptions>
                        <includes>
                                <include>org.apache.maven:apache-maven</include>
                        </includes>
                        <useProjectArtifact>false</useProjectArtifact>
                </dependencySet>
{noformat}

I tried to bypass archiva and directly connect to central, but the same error 
occurs.

> artifact of packaging 'tar.gz' / dependency of type 'tar.gz downloaded, but 
> not saved to local repository
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3078
>                 URL: http://jira.codehaus.org/browse/MNG-3078
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Artifacts and Repositories, Dependencies
>    Affects Versions: 2.0.6, 2.0.7
>            Reporter: Peter Lynch
>            Priority: Critical
>             Fix For: 2.0.x
>
>
> Using mvn deploy:deploy-file you can successfully upload a 'tar.gz' artifact 
> to a repository.
> Example without classifier:
> mvn deploy:deploy-file -DgroupId=org.apache.tomcat -DartifactId=apache-tomcat 
> -Dversion=6.0.13 -Dpackaging=tar.gz -DrepositoryId=repo-central 
> -Durl=dav:http://repo.example.com:4000/maven-repos/repo-central/ 
> -Dfile=apache-tomcat-6.0.13.tar.gz
> Example with classifier
> mvn deploy:deploy-file -DgroupId=org.apache.tomcat -DartifactId=apache-tomcat 
> -Dversion=6.0.13 -Dpackaging=tar.gz -Dclassifier=bin 
> -DrepositoryId=repo-central 
> -Durl=dav:http://repo.example.com:4000/maven-repos/repo-central/ 
> -Dfile=apache-tomcat-6.0.13.tar.gz
> Once uploaded define a dependency in your pom to it.
> Example without classifier
> <project>
> <packaging>pom</packaging>
> ...
> <dependencies>
>   ...
>   <dependency>
>       <groupId>org.apache.tomcat</groupId>
>       <artifactId>apache-tomcat</artifactId>
>       <version>6.0.13</version>
>       <type>tar.gz</type>
>       <optional>true</optional>
>     </dependency>
>   ...
> </dependencies>
> ...
> </project>
> Example with classifier
> <project>
> <packaging>pom</packaging>
> ...
> <dependencies>
>   ...
>   <dependency>
>       <groupId>org.apache.tomcat</groupId>
>       <artifactId>apache-tomcat</artifactId>
>       <version>6.0.13</version>
>       <type>tar.gz</type>
>       <classifier>bin</classifier>
>       <optional>true</optional>
>     </dependency>
>   ...
> </dependencies>
> ...
> </project>
> Now to reproduce the problem you could either do
> mvn dependency:resolve
> or 
> mvn assembly:assembly
> (if the maven assembly plugin is configured with a dependency set that 
> unpacks this dependency for example)
> ----
> The reason I think this is a core bug and not an maven assembly plugin or 
> maven-dependency-plugin bug is because the problem happens in both of these 
> independent plugins.
> When you run 'mvn dependency:resolve'  you'll see that the dependency appears 
> downloaded but then the build fails with :
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
> Missing:
> ----------
> 1) org.apache.tomcat:apache-tomcat:tar.gz:bin:6.0.13
>   Try downloading the file manually from the project website.
>   Then, install it using the command: 
>       mvn install:install-file -DgroupId=org.apache.tomcat 
> -DartifactId=apache-tomcat \
>           -Dversion=6.0.13 -Dclassifier=bin -Dpackaging=tar.gz 
> -Dfile=/path/to/file
> Alternatively, if you host your own repository you can deploy the file there: 
>       mvn deploy:deploy-file -DgroupId=org.apache.tomcat 
> -DartifactId=apache-tomcat \
>           -Dversion=6.0.13 -Dclassifier=bin -Dpackaging=tar.gz 
> -Dfile=/path/to/file \
>            -Durl=[url] -DrepositoryId=[id]
>   Path to dependency: 
>         1) com.example:core:pom:1.0.0-A1-SNAPSHOT
>         2) org.apache.tomcat:apache-tomcat:tar.gz:bin:6.0.13
> ----------
> 1 required artifact is missing.
> ...
> ... and even stranger here is the log which proves the dependency was found 
> in the repo and downloaded, but NOT saved to local repository.
> ...
> [DEBUG] Trying repository repo-central
> Downloading: 
> http://repo.example.com:4000/maven-repos/repo-central/org/apache/tomcat/apache-tomcat/6.0.13/apache-tomcat-6.0.13-bin.tar.gz
> 5826K downloaded
> [DEBUG] Unable to get resource 
> 'org.apache.tomcat:apache-tomcat:tar.gz:bin:6.0.13' from repository 
> repo-central (http://repo.example.com:4000/maven-repos/repo-central)
> [DEBUG] Unable to download the artifact from any repository
> ..and YOU MAY GET FOOLED into thinking all is well. mvn deploy:deploy-file 
> also installs the same artifact into your local repo. So if you follow above 
> steps and don't get an error it is because the deploy-file goal installed it 
> in your local repo. However when someone else tries to use your project they 
> will get above error.
> So, first delete from your local repo. example:
> rm -rf ~/.m2/repository/org/apache/tomcat/apache-tomcat
> and then try to execute mvn dependency:resolve and it should fail as 
> described.
> ...and finally I'll mention that doing the same thing with a 'zip' 
> type/packaging there is NO PROBLEM.
> Ultimately when using the maven assembly plugin I should be able to specify 
> any type of dependency type supported by the maven assembly archiver.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to