S P
S P

Reputation: 1

Maven compile dependency error javax.mail missing

I am following the instructions in the lift guide book for set up the basic hello world application (On windows 7 using cygwin)

After doing this to start

mvn archetype:generate -U -DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-blank -DarchetypeVersion=2.0 \
-DarchetypeRepository=http://scala-tools.org/repo-releases \
-DgroupId=demo.helloworld -DartifactId=helloworld \
-Dversion=1.0-SNAPSHOT

Then

cd helloworld
mvn jetty:run

I get the following error

[ERROR] Failed to execute goal on project helloworld: Could not resolve dependencies for project demo.helloworld:helloworld:war:1.0-SNAPSHOT: Failed to collect dependencies for [net.liftweb:lift-mapper:jar:2.0 (compile), javax.servlet:servlet-api:jar:2.5 (provided), junit:junit:jar:4.7 (test), org.mortbay.jetty:jetty:jar:[6.1.6,7.0) (test), org.scala-lang:scala-compiler:jar:2.7.7 (test)]: No versions available for javax.mail:mail:jar:[1.4,1.4.3) within specified range -> [Help 1]

Before that there were two warning for checksum errors for the metadata.xml file. I put the checksum ignore in my pom file.

I downloaded the mailx API package from Oracle and put it in my classpath. After trying various solutions found for similar sounding errors nothing seems to work. Can someone suggest something?

PS: I searched for two days for the answers and tried all the solutions that came up in various threads but found no answer in them.

Upvotes: 0

Views: 1601

Answers (1)

Nishant
Nishant

Reputation: 55866

You need to explicitly add java.net repository to your pom.xml. (Which is very weird)

  <repositories>
    <repository>
    <id>Java.Net</id>
    <url>http://download.java.net/maven/2/</url>
    </repository>
    <!-- other repos -->
  </repositories>

Upvotes: 6

Related Questions