Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't Maven download jar files but does download plugins fine?

Tags:

java

maven

Ok I'm moving my development environment from my laptop to my desktop.

I've got the exact same projects on both machines but when I try to run maven's update dependencies through eclipse on the desktop is just complains about "missing artefact" for every single dependency!?

I've checked the local repo on the desktop and sure enough, there are NO jars!? All the pom's are there but no jars!

I went back to the laptop, deleted from jars from the local repo on that machine and called the update dependencies again and bang, the jars download just fine, but the desktop can't seem to download any of the jars?

Both machines are on the same network/router so it can't be hardware firewall/proxy but is there some eclipse setting or windows firewall setting I'm totally forgetting about??

Lastly, I've been deleteing the repo on the desktop and using mvn -up clean install on the project, I notice that it downloads the PLUGIN jars just fine, but then continues to only download poms for any and all dependencies!?

My settings.xml is as follows (kind of a mashup of suggested repos);

  <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0http://maven.apache.org/xsd/settings-1.0.0.xsd">

<pluginGroups></pluginGroups>
<proxies></proxies>
<servers></servers>
<mirrors></mirrors>
<profiles>

    <profile>
        <id>standard-extra-repos</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
            <repository>
                <id>net.java.download</id>
                <url>http://download.java.net/maven/2</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>org.apache</id>
                <url>http://maven.apache.org/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>org.codehaus.mojo</id>
                <url>http://mojo.codehaus.org/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>com.jboss.repository</id>
                <url>http://repository.jboss.com/maven2</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>com.springsource.repository.bundles.release
                </id>
                <name>SpringSource Enterprise Bundle Repository -
                    SpringSource Bundle Releases</name>
                <url>http://repository.springsource.com/maven/bundles/release
                </url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>daily</updatePolicy>
                    <checksumPolicy>warn</checksumPolicy>
                </releases>
            </repository>
            <repository>
                <id>com.springsource.repository.bundles.external
                </id>
                <name>SpringSource Enterprise Bundle Repository -
                    External Bundle Releases</name>
                <url>http://repository.springsource.com/maven/bundles/external
                </url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>daily</updatePolicy>
                    <checksumPolicy>warn</checksumPolicy>
                </releases>
            </repository>
            <repository>
                <id>com.springsource.repository.libraries.release
                </id>
                <name>SpringSource Enterprise Bundle Repository -
                    SpringSource Library Releases</name>
                <url>http://repository.springsource.com/maven/libraries/release
                </url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>daily</updatePolicy>
                    <checksumPolicy>warn</checksumPolicy>
                </releases>
            </repository>
            <repository>
                <id>com.springsource.repository.libraries.external
                </id>
                <name>SpringSource Enterprise Bundle Repository -
                    External Library Releases</name>
                <url>http://repository.springsource.com/maven/libraries/external
                </url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>daily</updatePolicy>
                    <checksumPolicy>warn</checksumPolicy>
                </releases>
            </repository>
        </repositories>
    </profile>

like image 934
Nick Foote Avatar asked Jan 13 '11 12:01

Nick Foote


People also ask

Why Maven dependencies are not getting downloaded?

Maven uses HTTP to download its dependencies along with the dependencies of the Maven project (such as Camel). If you run Maven and it fails to download your required dependencies it's likely to be caused by your local firewall & HTTP proxy configurations.

Can Maven download jar files?

Note that all parameters except transitive are required. Also note that Maven will download the jar to your local repository, and there's no sensible way (that I know of) to copy it to a local directory.

What is the difference between jar and plugin?

plug-in is a software component that adds a specific feature to any computer program.It specially use to customize any computer program. But . jar file is a java executable file which can only run on an environment which Java installed.


2 Answers

Hmm not sure if this is a no brainer but I WAS using maven 3.0.1 on the desktop, I downloaded 2.2.1 again to match the laptop and BANG, dependency jars download just fine now! So much for "backwards compatible" maven 3!!!!

like image 114
Nick Foote Avatar answered Oct 06 '22 01:10

Nick Foote


Have a look at the content of the downloaded POMs. Sometimes Maven try download them, even create them on the file system, but if you look at the content you'll find some server error code, maybe that can help..

like image 39
CodegistCRest Avatar answered Oct 06 '22 00:10

CodegistCRest