You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rodrigo Meza <ro...@gmail.com> on 2010/01/22 15:10:43 UTC

What to do with jars that are Moved (http-code: 302)

Hello,
 I am new to maven, and I am trying to compile a project that have
some dependencies, but they are not downloaded because (I think) their
jars have been redirected in the central repository. What can I do in
that case?

To show my problem, I deleted my local repository
(/home/user/.m2/repository), created a new example archetype project:

% mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app

and added a new dependency to the my-app pom.xml file:

   <dependency>
     <groupId>log4j</groupId>
     <artifactId>log4j</artifactId>
     <version>1.2.15</version>
     <scope>compile</scope>
   </dependency>

When the project is compiled, many stuff is downloaded, but at a
certain point I get this errors:

% mvn compile
...
Downloading: https://maven-repository.dev.java.net/nonav/repository/javax.mail/jars/mail-1.4.jar
349b downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'22c5a3603e08905d985a84fb0a7365e141be8816'; remote = '<!DOCTYPE' -
RETRYING
...
[INFO] Compilation failure

error: error reading
/home/user/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar; error in
opening zip file

after that, when looking in my local repository:

~/.m2/repository/javax/mail/mail/1.4% file mail-1.4.jar
mail-1.4.jar: HTML document text

and the content is:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a
href="http://download.java.net/maven/1/javax.mail/jars/mail-1.4.jar">here</a>.</p>
<hr>
<address>Apache Server at maven-repository.dev.java.net Port 443</address>
</body></html>


So, my question is: Is there any way to tell maven to follow
redirections instead of downloading the html?

Thanks in advance!
 Rodrigo.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What to do with jars that are Moved (http-code: 302)

Posted by Rodrigo Meza <ro...@gmail.com>.
On Fri, Jan 22, 2010 at 11:44 AM, Wayne Fay <wa...@gmail.com> wrote:

> people's builds for reasons like this. Maven simply can't help this
> and is not currently smart enough to validate jars etc it downloads.

thanks for your answer. Anyway, I dont think that maven has to
validate jars, since the http request returns a 302 error code. I
thought that maven could just follow the new url to the resource,
without even needing to validate the jar content.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What to do with jars that are Moved (http-code: 302)

Posted by Wayne Fay <wa...@gmail.com>.
> <address>Apache Server at maven-repository.dev.java.net Port 443</address>
> </body></html>
>
> So, my question is: Is there any way to tell maven to follow
> redirections instead of downloading the html?

Maven is reasonably intelligent but it requires proper configuration
of the repository server. In this case, you're trying to pull from a
dev.java.net repo and if you search my previous posts, you'll see that
I have a pretty low opinion of this repo as it breaks a lot of
people's builds for reasons like this. Maven simply can't help this
and is not currently smart enough to validate jars etc it downloads.

IIRC the javax.mail artifact must be installed manually anyway due to licensing.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org