You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by partha_ctc <pa...@rediffmail.com> on 2008/10/16 08:45:08 UTC
jars in the custom ear not getting referenced at compile time
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.
<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>
http://www.nabble.com/file/p20008047/pom.xml pom.xml
--
View this message in context: http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008047.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: jars in the custom ear not getting referenced at compile time
Posted by partha_ctc <pa...@rediffmail.com>.
Hi,
if i have lots of jars and rather than mentioning eah arifacts there
should be one approach to bundle many jar in some jar or war and getting the
reference in the dependancy tag.
Wayne Fay wrote:
>
> Your approach will not work. The Java compiler does not know how to
> find compiled Java classes inside Jars inside Ears. Effectively, you
> cannot depend on an EAR in another project.
>
> Instead, you need to depend directly on the Struts artifacts in this
> project.
>
> There may be a way to make this work with transitive dependencies but
> since you constructed the EAR file manually, that is not an option for
> you either.
>
> Wayne
>
> On Wed, Oct 15, 2008 at 11:45 PM, partha_ctc
> <pa...@rediffmail.com> wrote:
>>
>> 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.
>>
>> <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>
>>
>>
>>
>> http://www.nabble.com/file/p20008047/pom.xml pom.xml
>> --
>> View this message in context:
>> http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008047.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
--
View this message in context: http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008971.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: jars in the custom ear not getting referenced at compile time
Posted by partha_ctc <pa...@rediffmail.com>.
Hi,
if i have lots of jars and rather than mentioning eah arifacts there
should be one approach to bundle many jar in some jar or war and getting the
reference in the dependancy tag.
Wayne Fay wrote:
>
> Your approach will not work. The Java compiler does not know how to
> find compiled Java classes inside Jars inside Ears. Effectively, you
> cannot depend on an EAR in another project.
>
> Instead, you need to depend directly on the Struts artifacts in this
> project.
>
> There may be a way to make this work with transitive dependencies but
> since you constructed the EAR file manually, that is not an option for
> you either.
>
> Wayne
>
> On Wed, Oct 15, 2008 at 11:45 PM, partha_ctc
> <pa...@rediffmail.com> wrote:
>>
>> 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.
>>
>> <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>
>>
>>
>>
>> http://www.nabble.com/file/p20008047/pom.xml pom.xml
>> --
>> View this message in context:
>> http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008047.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
--
View this message in context: http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008972.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: jars in the custom ear not getting referenced at compile time
Posted by partha_ctc <pa...@rediffmail.com>.
Hi,
if i have lots of jars and rather than mentioning eah arifacts there
should be one approach to bundle many jar in some jar or war and getting the
reference in the dependancy tag.
Wayne Fay wrote:
>
> Your approach will not work. The Java compiler does not know how to
> find compiled Java classes inside Jars inside Ears. Effectively, you
> cannot depend on an EAR in another project.
>
> Instead, you need to depend directly on the Struts artifacts in this
> project.
>
> There may be a way to make this work with transitive dependencies but
> since you constructed the EAR file manually, that is not an option for
> you either.
>
> Wayne
>
> On Wed, Oct 15, 2008 at 11:45 PM, partha_ctc
> <pa...@rediffmail.com> wrote:
>>
>> 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.
>>
>> <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>
>>
>>
>>
>> http://www.nabble.com/file/p20008047/pom.xml pom.xml
>> --
>> View this message in context:
>> http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008047.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
--
View this message in context: http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008971.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Index plc is a company registered in England and Wales under number 01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the Financial Services Authority. FSA Register number 114059.
Re: jars in the custom ear not getting referenced at compile time
Posted by partha_ctc <pa...@rediffmail.com>.
Hi,
if i have lots of jars and rather than mentioning eah arifacts there
should be one approach to bundle many jar in some jar or war and getting the
reference in the dependancy tag.
Wayne Fay wrote:
>
> Your approach will not work. The Java compiler does not know how to
> find compiled Java classes inside Jars inside Ears. Effectively, you
> cannot depend on an EAR in another project.
>
> Instead, you need to depend directly on the Struts artifacts in this
> project.
>
> There may be a way to make this work with transitive dependencies but
> since you constructed the EAR file manually, that is not an option for
> you either.
>
> Wayne
>
> On Wed, Oct 15, 2008 at 11:45 PM, partha_ctc
> <pa...@rediffmail.com> wrote:
>>
>> 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.
>>
>> <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>
>>
>>
>>
>> http://www.nabble.com/file/p20008047/pom.xml pom.xml
>> --
>> View this message in context:
>> http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008047.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
--
View this message in context: http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008972.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Index plc is a company registered in England and Wales under number 01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the Financial Services Authority. FSA Register number 114059.
Re: jars in the custom ear not getting referenced at compile time
Posted by Wayne Fay <wa...@gmail.com>.
There are ways to do this. Bundling everything in an EAR and expecting
it to work is not one of them.
One way to do this would be to create a separate project with
packaging "pom" and then specify all the dependencies there
(individually). Then in your ear project, add a <dependency> on that
project with packaging "pom". If some of your dependencies are not
available in the Maven repo, you will need to add them with "mvn
install:install-file".
But this is not always the right solution. Surely all of your projects
do not require the exact same 50+ jars. Such a coarse approach to
dependencies is not advisable for the long-term, generally.
Wayne
On Thu, Oct 16, 2008 at 1:01 AM, partha_ctc
<pa...@rediffmail.com> wrote:
>
> Hi,
> if i have lots of jars and rather than mentioning eah arifacts there
> should be one approach to bundle many jar in some jar or war and getting the
> reference in the dependancy tag.
>
> Wayne Fay wrote:
>>
>> Your approach will not work. The Java compiler does not know how to
>> find compiled Java classes inside Jars inside Ears. Effectively, you
>> cannot depend on an EAR in another project.
>>
>> Instead, you need to depend directly on the Struts artifacts in this
>> project.
>>
>> There may be a way to make this work with transitive dependencies but
>> since you constructed the EAR file manually, that is not an option for
>> you either.
>>
>> Wayne
>>
>> On Wed, Oct 15, 2008 at 11:45 PM, partha_ctc
>> <pa...@rediffmail.com> wrote:
>>>
>>> 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.
>>>
>>> <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>
>>>
>>>
>>>
>>> http://www.nabble.com/file/p20008047/pom.xml pom.xml
>>> --
>>> View this message in context:
>>> http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008047.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008970.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: jars in the custom ear not getting referenced at compile time
Posted by partha_ctc <pa...@rediffmail.com>.
Hi,
if i have lots of jars and rather than mentioning eah arifacts there
should be one approach to bundle many jar in some jar or war and getting the
reference in the dependancy tag.
Wayne Fay wrote:
>
> Your approach will not work. The Java compiler does not know how to
> find compiled Java classes inside Jars inside Ears. Effectively, you
> cannot depend on an EAR in another project.
>
> Instead, you need to depend directly on the Struts artifacts in this
> project.
>
> There may be a way to make this work with transitive dependencies but
> since you constructed the EAR file manually, that is not an option for
> you either.
>
> Wayne
>
> On Wed, Oct 15, 2008 at 11:45 PM, partha_ctc
> <pa...@rediffmail.com> wrote:
>>
>> 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.
>>
>> <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>
>>
>>
>>
>> http://www.nabble.com/file/p20008047/pom.xml pom.xml
>> --
>> View this message in context:
>> http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008047.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
--
View this message in context: http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008970.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: jars in the custom ear not getting referenced at compile time
Posted by Wayne Fay <wa...@gmail.com>.
Your approach will not work. The Java compiler does not know how to
find compiled Java classes inside Jars inside Ears. Effectively, you
cannot depend on an EAR in another project.
Instead, you need to depend directly on the Struts artifacts in this project.
There may be a way to make this work with transitive dependencies but
since you constructed the EAR file manually, that is not an option for
you either.
Wayne
On Wed, Oct 15, 2008 at 11:45 PM, partha_ctc
<pa...@rediffmail.com> wrote:
>
> 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.
>
> <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>
>
>
>
> http://www.nabble.com/file/p20008047/pom.xml pom.xml
> --
> View this message in context: http://www.nabble.com/jars-in-the-custom-ear-not-getting-referenced-at-compile-time-tp20008047p20008047.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>