I have two mavenized projects
- Project_A: Java Project
- Project_B: Java Web Project
Earlier, before mavenizing both projects, i had refrence(buildpath) of Project_A in Project_B. Now i have configured both projects with maven2. MY questions is, how can i add a refrence of Project_A in Project_B that WAR of Project_B can be runnable
so far i have tried following chunk of code which seems to work but on runtime Project_B's WAR throw an exception in applicationContext that an Instance of Project_A's class cannot be initiated.
1- Project_A is cleaned and installed in local repository with name "myproject-1.0.jar" where build snippet(Project_A's POM) is as follows#
Edited Part
<modelVersion>4.0.0</modelVersion>
<groupId>org.myurl<groupId>
<artifactId>projectA</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>${project.artifactId}-${project.version}</name>
build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<outputDirectory>${basedir}/target/classes</outputDirectory>
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
<testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>${basedir}/src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<optimize>true</optimize>
</configuration>
</plugin>
</plugins>
</build>
Snippet of Project_B's POM, where i am adding installed jar of Project_A
<dependency> <groupId>org.myurl</groupId> <artifactId>projectA</artifactId> <version>1.0</version> <scope>compile</scope> </dependency>
Thanks for suggestions in advance.
Answer : Actually there was not any problem with maven. Above configurations in POM are absolutely correct. I had moved properties files under /Resources and later i have forgotten to change paths in those classed where properties files are utilized.
Nevertheless i am thankful to Dolphin and Nicola Musatti for their suggestions.