I'm trying to implement my own jar (library) in another project I'm working on. But I'm getting the error NoClassDefFoundError when I run the program and try to instantiate a class from the library I built.
I try to add the dependency in different ways, with maven local repo or adding the jar file directly as an external jar in Build Path. I don't get any warning/error in eclipse and I can build and install the app with maven successfully. But when I execute the part of the code that use a class from that library I get NoClassDefFoundError.
My library groupId is com.mycompany.myapp, and the classes I'm using are in the package com.mycompany.myapp.business. I'm try to move the class to the parent package just in case but I'm always getting the same error.
1 - Do I need to define which classes need to be available when importing the jar?
2- Do I need to compile the library in an specific way apart from mvn clan package/install?
3 - Do I need to add the same dependencies I have in my library in my parent project to have everything working?
This is my children 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.mylibrary</groupId>
<artifactId>mylibrary</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.6</version>
</dependency>
<dependency>
<groupId>javax.xml.rpc</groupId>
<artifactId>javax.xml.rpc-api</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.47</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.47</version>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>javax.xml.rpc</groupId>
<artifactId>javax.xml.rpc-api</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.5.0-M1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.5.0-M1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.5.0-M1</version>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.3.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</project>
And then in my main project I instantiate the class in the following way:
Init oInit = new Init();
Where Init is a public class defined in com.mycompany.mylibrary.business package.
java.lang.NoClassDefFoundError: com/mycompany/mylibrary/business/Init
pom.xml from the main proyect:
<dependency>
<groupId>com.mycompany.mylibrary</groupId>
<artifactId>mylibrary</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
In the parent project, in the libraries imported by maven I see that my library has a folder icon instead of the one the other have.
You can use the two ways to include a library into your project:
Including the library directly into your project classpath
Through Maven
When using the Maven option, you must be sure that the library is well exported to the Maven repository, local or remote (such as Nexus). The first place Maven will search when looking for a library defined in the pom.xml is on your local repository (located at ~/.m2). The it will look into the Central Maven Repository (located at https://mvnrepository.com/repos/central). In between, you can declare your own repositories into your pom.xml as
<repositories>
<repository>
<id>my-repo</id>
<name>My Maven Repository</name>
<url>${nexus.repositories.url}</url>
</repository>
<repositories>
How to build the library to be included into your own local or remote repository? Just be sure to include the install goal when compiling with Maven, and also the repository definition into its pom.xml
Related
I'm facing problems when I'm trying to deploy my war file to the openshift repository.
The error is:
Could not resolve dependencies for project ... the following artifacts could not be found:
All these external jar's are included in the WEB-INF folder of my project and I've also tried to add a local repository but still no luck.
Can anyone help me with this please?
Image of error
here is my 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SussolWebservice</groupId>
<artifactId>SussolWebservice</artifactId>
<version>ROOT</version>
<packaging>war</packaging>
<properties>
<spring.version>4.0.1.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version> <!-- makesure correct version here -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
<version>4.4.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>weka</groupId>
<artifactId>weka</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\weka.jar</systemPath>
</dependency>
<dependency>
<groupId>opencsv</groupId>
<artifactId>opencsv</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\opencsv-3.7.jar</systemPath>
</dependency>
<dependency>
<groupId>logging</groupId>
<artifactId>logging</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\slf4j-log4j12-1.7.1.jar</systemPath>
</dependency>
<dependency>
<groupId>log</groupId>
<artifactId>log</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\slf4j-api-1.7.1.jar</systemPath>
</dependency>
<dependency>
<groupId>loggger</groupId>
<artifactId>logger</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\log4j-1.2.17.jar</systemPath>
</dependency>
<dependency>
<groupId>packagemgr</groupId>
<artifactId>packagemgr</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\packageManager.jar</systemPath>
</dependency>
<dependency>
<groupId>SOM</groupId>
<artifactId>SOM</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\WebContent\WEB-INF\lib\SelfOrganizingMap.jar</systemPath>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
I have checked your pom and found some dependencies with scope system, which means your JDK or container provides those jar's at a location you provide in the pom.
From the documentation:
system
This scope is similar to provided except that you have to
provide the JAR which contains it explicitly. The artifact is always
available and is not looked up in a repository.
provided
This is much like compile, but indicates you expect the JDK
or a container to provide the dependency at runtime. For example, when
building a web application for the Java Enterprise Edition, you would
set the dependency on the Servlet API and related Java EE APIs to
scope provided because the web container provides those classes. This
scope is only available on the compilation and test classpath, and is
not transitive.
More information here:
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
It is very likely openshift has no files like those provided as systempath's in your POM.
You can do one of the following:
Remove scope & system path from you depedencies, this way the
default (Compile) scope will be used and those jar's will be
included in your project.
Store the jar files you need in a folder on your openshift server (app-root/data, for example) and refer to that folder in your pom.
If you are using Tomcat, and all your applications running on this Tomcat are using the libraries you want to share, you can always store your shared libs in: tomcat-dir/common/lib (don't forget to change your scope to "provided" in this case).
I'm trying to build a REST API of web Services I created for my project.
My web services are working without problems.
Now, I want to Deploy my Services on a distant server and I need to generate the war file.
I'm using Java, Eclipse and Maven for dependencies. I tried to make a clean install and the only problem of failure is that :
[WARNING] The artifact jdbc:jdbc:jar:2.0 has been relocated to javax.sql:jdbc-stdext:jar:2.0
[INFO] Downloading: https://repo.maven.apache.org/maven2/javax/sql/jdbc-stdext/2.0/jdbc-stdext-2.0.jar
Could not find artifact javax.sql:jdbc-stdext:jar:2.0 in central (https://repo.maven.apache.org/maven2), try downloading from http://java.sun.com/products/jdbc/download.html
Anyone has a solution ?
P.S : Why i didn't face the problem while testing is because I added the jdbc-stdext-2.0.jar manually and now I'm in troubles.
My 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Tech4EarthServices</groupId>
<artifactId>Tech4EarthServices</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.17</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>2.17</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.19</version>
</dependency>
<dependency>
<groupId>jdbc</groupId>
<artifactId>jdbc</artifactId>
<version>2.0</version>
<exclusions>
<exclusion>
<artifactId>jdbc-stdext</artifactId>
<groupId>javax.sql</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.7.RELEASE</version>
</dependency>
</dependencies>
You experience the problem because you are including artifacts that have only source packages available. The maven dependency for jdbc.jdbc is referenced as a binary.
Most probably you don't need to include that dependency because those interfaces are provided by the JEE containers that you run your WAR archive in. I would recommend removing the jdbc artifact with the exlusion part entirely.
You can browse as what is available at jdbc/jdbc folder at Maven Central. And indeed the extension for it has removed under javax/sql at Maven Central.
I believe this is because you listed the artifact as an exclusion in your pom. i.e
<exclusions>
<exclusion>
<artifactId>jdbc-stdext</artifactId>
<groupId>javax.sql</groupId>
</exclusion>
</exclusions>
I think if you remove this block you will be fine
As shown in following screenshot - the project SDK and language level are 1.8:
And I went through all of the project modules: they are all likewise defined as 1.8. One of them is shown below:
Yet somehow IJ attached a language level of 1.4 to one of the modules
But actually .. it is not even that straightforward. E.g. the intellisense thinks 1.4:
But when I click on the java.lang.String underlined in red, it DOES go to 1.8:
The pom.xml for the culprit module 'icloud' makes no mention of any java level - so it is not to blame:
<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>org.apache.ignite</groupId>
<artifactId>ignite-parent</artifactId>
<version>1</version>
<relativePath>../../parent</relativePath>
</parent>
<artifactId>ignite-cloud</artifactId>
<version>1.1.3-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-allcompute</artifactId>
<version>${jcloud.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds.labs</groupId>
<artifactId>google-compute-engine</artifactId>
<version>${jcloud.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds.labs</groupId>
<artifactId>docker</artifactId>
<version>${jcloud.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds.provider</groupId>
<artifactId>cloudsigma-zrh</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
I have done Build|Rebuild twice. Also have done
mvn clean package
from command line twice. This is just a big time sink (/waste). So then: why is IJ sabotaging this module - and is there a workaround?
Add a the compiler plugin to pom.xml and reimport the pom will solve this issue
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
The problem was that intellij could not handle the examples subproject being
underneath a parent directory containing the main parent project
but the directory is its own self contained project with no relation to the parent
The workaround is to create an entirely independent project for the examples module.
The other suggested answer - about adding the compiler plugin - made no difference.
I created a Google App Engine maven project according to this documentation and it works successfully. Then after i import the same project into eclipse by using the option Existing Maven Project . But in eclipse its only just maven project without having java facet.Then i manually added facet by right clicking Project -> Properties -> Project Facet -> Tick on java option. Now eclipse shows java errors on my created application (for some app engine related classes). But this project works fine by using maven command like mvn clean install and mvn appengine:devserver. Here follows the pom for my maven project
<?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.google.appengine.demos</groupId>
<artifactId>guestbook</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<appengine.target.version>1.9.0</appengine.target.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.target.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<modules>
<module>guestbook-war</module>
<module>guestbook-ear</module>
</modules>
</project>
You do not appear to have any dependencies in you pom. These define the libraries your application depend on. Minimally, for an appengine war, you'll need something like this:
<dependencies>
<!-- Servlet dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>2.2.4</version>
<scope>provided</scope>
</dependency>
<!-- GAE Dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${gae.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
If you also want to do some unit testing, you'll need to add the following to the above block:
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>${gae.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>${gae.version}</version>
<scope>test</scope>
</dependency>
If you want to work in eclipse, make sure you have the wtp-m2e eclipse plugin installed, and the Google Plugin for Eclipse plugin installed. They'll make your life much easier.
I have one java web project which is having pom.xml as mention below.
<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.csam.product</groupId>
<artifactId>wallet-server</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>wallet-server</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<version>3.0</version>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
<finalName>wallet-server</finalName>
</build>
<dependencies>
<dependency>
<groupId>com.csam.enabling</groupId>
<artifactId>comms</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.csam.enabling</groupId>
<artifactId>user_profile</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.csam.enabling</groupId>
<artifactId>wallet</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.csam.service</groupId>
<artifactId>payment_card_service</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.27</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.5.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
<version>1.6.13</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>opensaml</artifactId>
<groupId>org.opensaml</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>4.2.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>javax.xml.stream</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>stax2-api</artifactId>
<version>3.1.1</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>javax.xml.stream</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>1.5.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.csam.enabling</groupId>
<artifactId>message_replay_detector</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.7.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.3.Final</version>
<scope>compile</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
in that comms,user_profile,wallet,payment_card_service are the dependencies of other projects.
Now, when i am trying to fire mvn compile or mvn package command on my this project, it'll giving me an error as mention below,
[ERROR] /E:/cvs-projects-command/customers/prd_mno_nfc_wallet/server/webtier/src/main/java/com/csam/product/se_wallet/view/wallet/ChangeServicesController.java:[14,59] E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\webtier\src\main\java\com\csam\product\se_wallet\view\wallet\ChangeServicesController.java:14: package com.csam.product.se_wallet.comms.emvelopeprocessing does not exist
[ERROR] /E:/cvs-projects-command/customers/prd_mno_nfc_wallet/server/webtier/src/main/java/com/csam/product/se_wallet/view/wallet/ChangeServicesController.java:[15,59] E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\webtier\src\main\java\com\csam\product\se_wallet\view\wallet\ChangeServicesController.java:15: package com.csam.product.se_wallet.comms.emvelopeprocessing does not exist
[ERROR] /E:/cvs-projects-command/customers/prd_mno_nfc_wallet/server/webtier/src/main/java/com/csam/product/se_wallet/view/wallet/ChangeServicesController.java:[16,50] E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\webtier\src\main\java\com\csam\product\se_wallet\view\wallet\ChangeServicesController.java:16: package com.csam.product.se_wallet.comms.validator does not exist
[ERROR] /E:/cvs-projects-command/customers/prd_mno_nfc_wallet/server/webtier/src/main/java/com/csam/product/se_wallet/view/wallet/ChangeServicesController.java:[24,45] E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\webtier\src\main\java\com\csam\product\se_wallet\view\wallet\ChangeServicesController.java:24: cannot find symbol
symbol : class ChangeService
location: package com.csam.wsc.service.wallet.lifecycle
[ERROR] /E:/cvs-projects-command/customers/prd_mno_nfc_wallet/server/webtier/src/main/java/com/csam/product/se_wallet/view/wallet/ChangeServicesController.java:[75,81] E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\webtier\src\main\java\com\csam\product\se_wallet\view\wallet\ChangeServicesController.java:75: package com.csam.product.se_wallet.comms.emvelopeprocessing does not exist
[ERROR] /E:/cvs-projects-command/customers/prd_mno_nfc_wallet/server/webtier/src/main/java/com/csam/product/se_wallet/view/wallet/ChangeServicesController.java:[81,17] E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\webtier\src\main\java\com\csam\product\se_wallet\view\wallet\ChangeServicesController.java:81: cannot find symbol
symbol : class ChangeService
location: class com.csam.product.se_wallet.view.wallet.ChangeServicesController
[ERROR] /E:/cvs-projects-command/customers/prd_mno_nfc_wallet/server/webtier/src/main/java/com/csam/product/se_wallet/view/wallet/ChangeServicesController.java:[300,89] E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\webtier\src\main\java\com\csam\product\se_wallet\view\wallet\ChangeServicesController.java:300: package com.csam.product.se_wallet.comms.emvelopeprocessing does not exist
[ERROR] /E:/cvs-projects-command/customers/prd_mno_nfc_wallet/server/webtier/src/main/java/com/csam/product/se_wallet/view/wallet/ChangeServicesController.java:[320,31] E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\webtier\src\main\java\com\csam\product\se_wallet\view\wallet\ChangeServicesController.java:320: cannot find symbol
symbol : class ChangeService
location: class com.csam.product.se_wallet.view.wallet.ChangeServicesController
that means it's not getting the dependent jars of other projects.
So is there any way to resolve this problem ?
Please help....
It seems to find the CVS Path, but cannot find the class ChangeService and the packages com.csam.product.se_wallet.comms.emvelopeprocessing, com.csam.product.se_wallet.comms.validator
Are you sure that this class and the other packages are committed...
try to commit those struff again..
You have two projets: Blammo and wallet-server.
Option 1
Use maven when building Blammo and execute the install maven task when building Blammo.
This will update the Blammo snapshot in your local maven repository.
Add a dependancy to the Blammo snapshot in your wallet-server pom file.
Do not update snapshots during this build unless you also add the Blammo snapshot to your local nexus.
Option 2
Use option 1, but if you hate doing things that way, do the following:
Build Blammo into a jar however you want.
Manually add the Blammo jar to your local maven repository.
Add a dependancy to the Blammo snapshot in your wallet-server pom file.
Do not update snapshots during this build unless you also add the Blammo snapshot to your local nexus.
Those dependencies does not seem to be present in your local repository.
If you compiled those dependencies locally you may want check if you did run "mvn install".
Otherwise, Check if your settings.xml or your pom/parent pom refers the repository that contains those dependencies.
http://maven.apache.org/guides/mini/guide-multiple-repositories.html