0

I am trying to run an already existing maven application. While doing so, it is always looking for downloading the file from the artifactory (javaguru....). I have given the jar files in lib folder in the project but they are not taken into account. Anyone faced this issue? I did see a lot of questions based on this but the answers do not help me.

[ERROR] Failed to execute goal on project nlas: Could not 
resolve dependencies for project com.metasystems:nlas
:grails-app:1.0-SNAPSHOT: Failed to collect dependencies
 at org.grails:grails-crud:jar:2.3.4: Failed to read artifact descriptor
 for org.grails:grails-crud:jar:2.3.4: Could not transfer artifact 
org.grails:grails-crud:pom:2.3.4 from/to metasystems-snapshots (http://javaguru.metasystems.com:8081/artifactory/metasystems-snapshot):
 Failed to transfer file: http://javaguru.metasystems.com:8081/
artifactory/metasystems-snapshot/org/grails/grails-crud/2.3.4/grails-crud-2.3.4.pom. Return code is:
 409 , ReasonPhrase:The repository 'metasystems-snapshot' rejected the 
artifact 'metasystems-snapshot:org/grails/
grails-crud/2.3.4/grails-crud-2.3.4.pom' due to its snapshot/
release handling policy.. -> [Help 1]

Dependencies from pom.xml

 <dependencies>
        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-bootstrap</artifactId>
            <version>${grails.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.gpars</groupId>
                    <artifactId>gpars</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.gant</groupId>
                    <artifactId>gant_groovy1.7</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.gparallelizer</groupId>
                    <artifactId>GParallelizer</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.gant</groupId>
                    <artifactId>gant_groovy1.6</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-launcher</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ivy</groupId>
                    <artifactId>ivy</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-crud</artifactId>
            <!--version>${grails.version}</version-->
            <version>2.2.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.grails</groupId>
                    <artifactId>grails-docs</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-launcher</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-test</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>radeox</groupId>
                    <artifactId>radeox</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-digester</groupId>
                    <artifactId>commons-digester</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.persistence</groupId>
                    <artifactId>persistence-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-gorm</artifactId>
            <version>1.3.7</version>
            <!--version>${grails.version}</version-->
            <exclusions>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-launcher</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-digester</groupId>
                    <artifactId>commons-digester</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate</artifactId>
                </exclusion>
                <!--
                                <exclusion>
                                    <groupId>org.hibernate</groupId>
                                    <artifactId>hibernate-annotations</artifactId>
                                </exclusion>
                                <exclusion>
                                    <groupId>org.hibernate</groupId>
                                    <artifactId>hibernate-commons-annotations</artifactId>
                                </exclusion>
                -->
                <exclusion>
                    <groupId>antlr</groupId>
                    <artifactId>antlr</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-test</artifactId>
            <version>${grails.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>

        <!-- Grails defaults to Ehache for the second-level Hibernate cache. -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-ehcache</artifactId>
            <version>3.3.1.GA</version>
            <exclusions>
                <!-- See http://www.slf4j.org/faq.html#IllegalAccessError -->
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>

                <!-- We are pulling in ehcache-core below -->
                <exclusion>
                    <groupId>net.sf.ehcache</groupId>
                    <artifactId>ehcache</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache-core</artifactId>
            <version>1.7.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- For ease of development and testing, we include the HSQLDB database. -->
        <dependency>
            <groupId>hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>1.8.0.10</version>
        </dependency>

        <!-- Use Log4J for logging. This artifact also pulls in the Log4J JAR. -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.5.8</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.5.8</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Needed in the case of AOP usage -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.6.8</version>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.6.8</version>
        </dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.3</version>
        </dependency>

        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
        </dependency>

        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
            <version>1.5.3</version>
        </dependency>
        <!-- START OF PROJECT DEPENDENCIES -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math</artifactId>
            <version>2.2</version>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin</artifactId>
            <version>${vaadin.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1</version>
        </dependency>

        <!--Spring Security-->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring.security.version}</version>
            <!--version>${org.springframework.security.version}</version-->
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${spring.security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring.security.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.5</version>
        </dependency>

        <dependency>
            <groupId>org.perf4j</groupId>
            <artifactId>perf4j</artifactId>
            <version>0.9.12</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.21</version>
        </dependency>

        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.2</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <!--version>2.0.3</version-->
            <version>3.2.8-RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>2.0.3</version>
            <!--version>3.2.8-RELEASE</version-->
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>3.2.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>2.0.3</version>
            <!--version>3.2.8-RELEASE</version-->
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>3.0.0.RELEASE</version>
            <!--version>3.2.8-RELEASE</version-->
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>3.1.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <version>3.0.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>3.0.6.RELEASE</version>
        </dependency>

        <!--added by vidhya ends-->
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1.1</version>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.16</version>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
Malwinder Singh
  • 6,644
  • 14
  • 65
  • 103
Diya
  • 31
  • 5
  • 1
    Please paste your dependency declaration. – JBaruch Aug 19 '14 at 21:12
  • JBaruch, I just added the dependencies from pom.xml. Any help is greatly appreciated. thanks. – Diya Aug 20 '14 at 14:26
  • possible duplicate of [Can I add jars to maven 2 build classpath without installing them?](http://stackoverflow.com/questions/364114/can-i-add-jars-to-maven-2-build-classpath-without-installing-them) – JBaruch Aug 21 '14 at 05:37

1 Answers1

0

Those dependencies will come from the repository configured in your pom.xml or settings.xml.It looks like your Maven is configured to resolve from Artifactory (which is a good thing to do).

If you want to add your own files to be resolved by Maven you should deploy them to Artifactory. If this instance is not in your control you should install your own instance of Artifactory inside your team/organization and configure your Maven installation to resolve from it.

I really recommend reading the DZone Refcard on this.

JBaruch
  • 22,610
  • 5
  • 62
  • 90
  • is there any way I can change the setting to look for the dependencies in lib folder (adding the jars to lib) instead of the artifactory? – Diya Aug 20 '14 at 19:20
  • In theory [you can](http://stackoverflow.com/questions/364114/can-i-add-jars-to-maven-2-build-classpath-without-installing-them), but this is **really** bad idea (read the notes under the answer I pointed you to). It makes your local build not reproducible on any other machine inc. your build server. Bad idea. – JBaruch Aug 21 '14 at 05:37