Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jars in the custom ear not getting referenced at compile time

 
partha sarathi samantaray
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
please help me in getting the solution.
1) i had put many jars like struts1.2.9.jar , junti.jar etc in a lib folder. then make it as colib.ear.
2) Then try to install as
mvn install:install-file ���DgroupId=repackage.oracle.ebilling ���DartifactId=colib ���Dversion=6.0 ���Dpackaging=ear ���Dfile=colib.EAR

3) Then I found colib-6.0.EAR has been created in my repository as repo3\repackage\oracle\ebilling\ebilling\6.0\ colib-6.0.EAR

4) when i tried to compile with mvn packaging it gives that package org.apache.struts.action does not exist , though it is in the colib-6.0.ear. as it does not found the jars in the classpath
5) my pom file as below. and i have attached the pom file.
i have mentioned that in dependancy tag.

<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>root.project</groupId>
<artifactId>practice-war</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>test-webapp</name>
<dependencies>
<dependency>
<groupId>repackage.oracle.ebilling</groupId>
<artifactId>colib</artifactId>
<version>6.0</version>
<type>ear</type>
<scope>provided</scope>
</dependency>

</dependencies>
<build>
<directory>target</directory>
<outputDirectory>target/classes</outputDirectory>
<finalName>maven2example_testfinalweb</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>$\{basedir\}/ebilling</directory>
<targetPath>ebilling</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<!-- <fork>true</fork> -->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<plugin><groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<dependentWarIncludes>**/images</dependentWarIncludes>
<dependentWarExcludes>WEB-INF/web.xml,index.*</dependentWarExcludes>
<workDirectory>target/war/work</workDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>auto-clean</id>
<phase>validate</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dependency-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-eBilling-App</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>repackage.oracle.ebilling</groupId>
<artifactId>colib</artifactId>
<version>6.0</version>
<type>ear</type>
</artifactItem>
</artifactItems>
<outputDirectory></outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<displayName>eBilling App</displayName>
<description>(C)Copyright 1999-2007 Oracle(R), Inc. All Rights Reserved.</description>
<version>6.0</version>
<earSourceDirectory>${project.build.directory}/dependency</earSourceDirectory>
<applicationXml>${project.build.directory}/dependency/META-INF/application.xml
</applicationXml>
<generateApplicationXml>false</generateApplicationXml>
<modules>
<!-- List Of Jar which is included inside the Lib Dir -->
<jarModule>
<groupId>repackage.oracle.ebilling</groupId>
<artifactId>colib</artifactId>
<bundleDir>lib</bundleDir>
</jarModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe I am misunderstanding something (or perhaps it is that your pom is not within code tags making it hard to read), but from what I see you are attempting to build using the EAR file as a dependency. You cannot do this - an EAR is not a JAR file, you cannot use an EAR as a compile dependency. If the compilation requires the struts classes, you need to mention them in your dependencies. At least, that is my understanding.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic