I have been trying to maven test my codes, but i keep having this in my console:
[INFO] Scanning for projects... [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building SonarQube Java :: Checks 2.3-SNAPSHOT [INFO]
------------------------------------------------------------------------ [WARNING] The POM for
org.codehaus.sonar-plugins.java:java-squid:jar:2.3-SNAPSHOT is
missing, no dependency information available [INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 2.791s [INFO] Finished at: Wed May 21 16:18:34 CST
2014 [INFO] Final Memory: 9M/61M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal on project java-checks: Could not
resolve dependencies for project
org.codehaus.sonar-plugins.java:java-checks:jar:2.3-SNAPSHOT: Could
not find artifact
org.codehaus.sonar-plugins.java:java-squid:jar:2.3-SNAPSHOT -> [Help
1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run
Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to
enable full debug logging. [ERROR] [ERROR] For more information about
the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
My pom.xml are:
<?xml version="1.0" encoding="UTF-8"?> <project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>java</artifactId>
<version>2.3-SNAPSHOT</version> </parent>
<artifactId>java-checks</artifactId>
<name>SonarQube Java :: Checks</name>
<dependencies>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-deprecated</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>java-squid</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.sonar.sslr</groupId>
<artifactId>sslr-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Is there anyway to resolve such error?
Try to add this as a repository in your pom.xml. In the XML element repositories, add this:
<repository>
<id>sonarplugins</id>
<url>http://repository-sonarplugins.forge.cloudbees.com/snapshot/</url>
</repository>
Maven try to get java-squid.jar in 2.3-SNAPSHOT version but it does not find it in your local repository, in the central Maven repository and in the repositories you indicate in your POM. The URL I give you is an URL for a public repo which contains the artifact you need. It should work, unless if there is other missing dependencies.
A few more thing: why do you use a SNAPSHOT lib? Are you really sure you want to do that?
Related
Here is my pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.mailer</groupId>
<artifactId>portfolio</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>portfolio</name>
<description>portfolio services</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.mailjet</groupId>
<artifactId>mailjet-client</artifactId>
<version>4.2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Build logs:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< com.mailer:portfolio >------------------------
[INFO] Building portfolio 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
.
.
.
[WARNING] The POM for org.hamcrest:hamcrest-core:jar:1.4-atlassian-1 is missing, no dependency information available
.
.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project portfolio: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.22.2 or one of its dependencies could not be resolved: Failure to find org.hamcrest:hamcrest-core:jar:1.4-atlassian-1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
**
Any idea why am getting this error related to hamcrest jar? I added the same version of the jar in .m2/repo/... but I still get the same error. Any idea which dependency in this POM is using it internally? Do I have to change any version?
Command used to build
mvn clean install
If I run this project as Spring Boot app then the service is up but what I need is a jar out of this to host in a cloud.
This was the issue with my local repository. I had to point to a new repo location under .m2 in settings.xml.
I am trying to deploy maven web app in the Heroku which have a dependency on some other application. When I am trying to deploy the app and getting this error. I have no clue what is going wrong in passing the dependency.
This is my pom.xml file
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.1.3.RELEASE
com.merizameen
merizameen
0.0.1-SNAPSHOT
merizameen
Frontend project for Merizameen
<properties>
<start-class>com.merizameen.MerizameenApplication</start-class>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!-- MY PROJECT -->
<dependency>
<groupId>com.merizameen</groupId>
<artifactId>merizameenbackend</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Error Logs---------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.953 s
[INFO] Finished at: 2019-04-16T18:29:11+00:00
[INFO] Final Memory: 20M/162M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project merizameen: Could not resolve dependencies for project com.merizameen:merizameen:jar:0.0.1-SNAPSHOT: Could not find artifact com.merizameen:merizameenbackend:jar:0.0.1-SNAPSHOT -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed
You'll need to add com.merizameen:merizameenbackend as an un-managed dependency with a command like:
$ mvn deploy:deploy-file -Durl=file:///path/to/yourproject/repo/ -Dfile=merizameenbackend.jar -DgroupId=com.merizameen -DartifactId=merizameenbackend -Dpackaging=jar -Dversion=1.0
See this guide: https://devcenter.heroku.com/articles/local-maven-dependencies
This question already has answers here:
How to add a dependency to a Spring Boot Jar in another project?
(12 answers)
Closed 5 years ago.
i am unable to build my springboot project,
I am using classes from another springboot jar, which i placed on the build path, its running in local via eclipse, but is not building, here's the error
"[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ContentManagementService 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # contentmanagementapi ---
[INFO] Deleting /home/bhargavgundu/git/contentmanagementservice/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # contentmanagementapi ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # contentmanagementapi ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 42 source files to /home/bhargavgundu/git/contentmanagementservice/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[32,31] package com.conduiraonline.apis does not exist
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[42,31] package com.conduiraonline.daos does not exist
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[52,35] cannot find symbol
symbol: class SlackService
location: package com.conduiraonline.services
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[85,17] cannot find symbol
symbol: class UserDAO
location: class com.conduiraonline.controller.ContentManagementControllerV1
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[87,17] cannot find symbol
symbol: class SlackService
location: class com.conduiraonline.controller.ContentManagementControllerV1
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[95,17] cannot find symbol
symbol: class LicenseV5
location: class com.conduiraonline.controller.ContentManagementControllerV1
[INFO] 6 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.917s
[INFO] Finished at: Tue Sep 12 17:16:44 IST 2017
[INFO] Final Memory: 24M/396M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project contentmanagementapi: Compilation failure: Compilation failure:
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[32,31] package com.conduiraonline.apis does not exist
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[42,31] package com.conduiraonline.daos does not exist
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[52,35] cannot find symbol
[ERROR] symbol: class SlackService
[ERROR] location: package com.conduiraonline.services
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[85,17] cannot find symbol
[ERROR] symbol: class UserDAO
[ERROR] location: class com.conduiraonline.controller.ContentManagementControllerV1
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[87,17] cannot find symbol
[ERROR] symbol: class SlackService
[ERROR] location: class com.conduiraonline.controller.ContentManagementControllerV1
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[95,17] cannot find symbol
[ERROR] symbol: class LicenseV5
[ERROR] location: class com.conduiraonline.controller.ContentManagementControllerV1
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
"
It is showing errors wherever i am using classes/functions from the external jar, can someone help?
MY POM-
here is my POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.conduiraonline</groupId>
<artifactId>contentmanagementapi</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>ContentManagementService</name>
<description>ContentManagementService</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.mail/mail -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.conduiraonline</groupId>
<artifactId>licenseapi</artifactId>
<version>0.0.1</version>
<classifier>exec</classifier>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>21.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>
</project>
TL;DR
Remove <classifier>exec</classifier> from the dependency on com.conduiraonline:licenseapi
More Details ...
You are correct in using <dependency> to express the relationship between com.conduiraonline:contentmanagementapi and com.conduiraonline:licenseapi. Or to put it another way; this is the right way to tell Maven that the module com.conduiraonline:contentmanagementapi depends on the module com.conduiraonline:licenseapi.
However, you have defined the dependency on com.conduiraonline:licenseapi as:
<dependency>
<groupId>com.conduiraonline</groupId>
<artifactId>licenseapi</artifactId>
<version>0.0.1</version>
<classifier>exec</classifier>
</dependency>
The classifier tells Maven to look for an file named licenseapi.exec in the folder com/conduiraonline in your local Maven repo (and failing that, try to resolve that dependency from whatever remote repositories you have configured in your Maven settings.xml or in this pom.xml).
I presume there is no file named licenseapi.exec in the folder com/conduiraonline in your local Maven repo because exec is a very unusual classifier for a Maven artifact.
As long as a JAR for com.conduiraonline:licenseapi with version 0.0.1 has been installed in your local Maven repo this dependency will work:
<dependency>
<groupId>com.conduiraonline</groupId>
<artifactId>licenseapi</artifactId>
<version>0.0.1</version>
</dependency>
You install a JAR for com.conduiraonline:licenseapi with version 0.0.1 in your local Maven repo by running mvn clean install for the licenseapi module (assuming that the pom.xml for the licenseapi modules has <version>0.0.1</version>).
You must add the path of your jars / folder containing jars in your gradle or maven build file.
For example in gradle add
compile fileTree(dir: 'path_to_ext_libs', include: '*.jar')
to your dependencies in the build.gradle then all the jars in the libs folder will be then included.
or in maven
<repositories>
<repository>
<id>local-files</id>
<name>local-files</name>
<url>file://c:\test\filerepo</url>
</repository>
When i run install Maven, it throws error like.
[INFO] java-COUNTER ...................................... SUCCESS [ 1.093 s]
[INFO] java-COUNTER Utils ................................ SUCCESS [ 1.312 s]
[INFO] java-COUNTER domain model ......................... SUCCESS [ 1.593 s]
[INFO] java-COUNTER persistence layer .................... FAILURE [ 2.843 s]
[INFO] java-COUNTER core functionality ................... SKIPPED
[INFO] java-COUNTER inbound message processor ............ SKIPPED
[INFO] java-COUNTER web commons .......................... SKIPPED
[INFO] java-COUNTER message receiver ..................... SKIPPED
[INFO] java-COUNTER client API definition ................ SKIPPED] java-COUNTER API implementation ................... SKIPPED
[INFO] STAR benchmarks ................................... SKIPPED
[INFO] java-COUNTER admin UI ............................. SKIPPED
[INFO] java-COUNTER reporting UI ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.029 s
[INFO] Finished at: 2015-08-06T17:01:33+05:30
[INFO] Final Memory: 26M/222M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project persistence: Could not resolve dependencies for project com.semantico.counter:persistence:jar:1.1.1: Could not find artifact com.semantico.counter:utils:jar:tests:1.1.1 in project_lib (file:///F:\ConnectBooks\star_15Jul15\star_15Jul15\persistence/mvnLib) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :persistence
My pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.semantico.counter</groupId>
<artifactId>parent</artifactId>
<version>1.1.1</version>
</parent>
<groupId>com.semantico.counter</groupId>
<artifactId>receiver</artifactId>
<name>java-COUNTER message receiver</name>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>com.semantico.counter</groupId>
<artifactId>web-commons</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
</dependency>
<dependency>
<groupId>com.codahale.metrics</groupId>
<artifactId>metrics-servlet</artifactId>
</dependency>
<dependency>
<!-- CD-1158 For double-click. NB: 2.1.0 is a bit old -->
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.1.0</version>
</dependency>
<!-- Test scope -->
<dependency>
<groupId>com.sun.jersey.jersey-test-framework</groupId>
<artifactId>jersey-test-framework-grizzly2</artifactId>
</dependency>
<dependency>
<groupId>com.riffpie.common.testing</groupId>
<artifactId>jersey-test-support</artifactId>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-apache-client</artifactId>
</dependency>
<dependency>
<groupId>com.sun.grizzly</groupId>
<artifactId>grizzly-webserver</artifactId>
</dependency>
<dependency>
<groupId>com.semantico.counter</groupId>
<artifactId>persistence</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>com.semantico.counter</groupId>
<artifactId>utils</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
</dependency>
<!-- Container provided -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
</dependencies>
Are you configuring a multi-module project? If so, have a look at some examples of how to configure them. If this is the approach you are taking then the parent pom should declare your persistence and utils projects as modules:-
<modules>
<module>persistence</module>
<module>utils</module>
</modules>
This way your parent should be able to access the jars resulting from building of the two modules - rather than having them as completely separate projects.
I just created web application using maven -3.2.3 and there after i just some dependencies in pom.xml next just right click on my pom.xml-->RunAs-->maven install.All jars are downloaded.Then while trying to build(like my pom.xml-->RunAs-->maven build) i got one pop up to set goal. i just typed goal field as a "package" -->run.
i am facing below issue
Downloaded: http://repo.maven.apache.org/maven2/org/springframework/spring/2.5.6/spring-2.5.6.jar (2881 KB at 3.3 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15:26.448s
[INFO] Finished at: Wed Oct 29 08:33:31 IST 2014
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project SpringMVCMaven: Could not resolve dependencies for project com.rajendra.spring:SpringMVCMaven:war:1.0: Failure to find javax.transaction:jta:jar:1.0.1B in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
and for reference below is the pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.rajendra.spring</groupId>
<artifactId>SpringMVCMaven</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>SpringMVCMaven Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.3.ga</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
</dependencies>
<build>
<finalName>SpringMVCMaven</finalName>
</build>
</project>
Could you suggest me where exactly things are getting wrong. Appreciating your help here
You're having a problem because you're using relatively old frameworks. They are dependent upon a version of JTA that could not be made available in a public repository due to licensing restrictions. In that era there were a number of artifacts like this that we had to download from Sun (after agreeing to the licence) and install in our own local repository.
Thankfully, in your case you just need to add:
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
to your pom.xml and that should override the older version.
This is a newer version but it only contains API classes (not implementations) and I believe that it is backward compatible.