views:

36

answers:

1

i'm running into a problem in my maven build recently, that it downloads a jar file for the javamail-1.4.jar or something, but it turns out the file is not a real jar file, it's actually a html with a link to where to get the correct jar.

it seems to be the repo has changed for that. but in my maven setting everything is supposely to go to our internal repo, i don't know how did that happen. but anyways, more importantly, how do i fix this problem so that it will download the correct jar file on a fresh install?

thanks!

+1  A: 

You either downloaded that jar before the setup of your settings.xml to use the corporate repository ~or~ the corporate repository contains the version you have. So, first check what the internal repository actually contains (if the javamail artifact is not the expected artifact, then download it and install it in your internal repo). Then delete the artifact from the local repository to re download it.

Update: My understanding is that you get this dependency transitively from log4j so you must be using log4j 1.2.15. To solve the problem, either install the missing dependency in your internal repository, or revert to log4j 1.2.14, or exclude the transitive dependencies from log4j 1.2.15:

<dependency>
  <groupId>log4j</groupId>
  <artifactId>log4j</artifactId>
  <version>1.2.15</version>
  <exclusions>
    <exclusion>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>
    </exclusion>
    <exclusion>
      <groupId>javax.jms</groupId>
      <artifactId>jms</artifactId>
    </exclusion>
    <exclusion>
      <groupId>com.sun.jdmk</groupId>
      <artifactId>jmxtools</artifactId>
    </exclusion>
    <exclusion>
      <groupId>com.sun.jmx</groupId>
      <artifactId>jmxri</artifactId>
    </exclusion>
  </exclusions>
</dependency>
Pascal Thivent
well, it seems it's actually the log4j that is using the javamail jar and that's invalid. how do i fix that?
fei