You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "S.Murali" <hi...@gmail.com> on 2007/11/28 14:01:44 UTC

Issue in dependency resolution to zip file (having muliple jars)

I have a Project A (util_common) which is a multi-module project which
generates a zip file during its assembly (which contains all its sub-module
jars) and i installed  it in the local repository using
install:install-file.

Now, I want to add dependency to Project A (util_common) zip file in the
Project B pom file.  
<dependency>
	<groupId>com.proj.risk</groupId>
	<artifactId>util_common</artifactId>			
	<version>1.0</version>
	<type>zip</type>
</dependency>

However, the dependency to the jar files inside the util_common zip file is
not getting resolved from Project B.

I  tried unpack all the jar files during the assembly phase, so that zip
file contains the sources of jar files rather individual jar files. But, it
did not work.

I think the problem might be due to some classpath issue while referencing,
though not sure. 

I would like to know if this is possible in maven?  If so, how?

Thanks in advance, Murali



-- 
View this message in context: http://www.nabble.com/Issue-in-dependency-resolution-to-zip-file-%28having-muliple-jars%29-tf4888364s177.html#a13991793
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: Issue in dependency resolution to zip file (having muliple jars)

Posted by Olivier Dehon <od...@gmail.com>.
Murali,

One way to solve this problem is to create a pom instead of a zip.
The pom will have all the dependencies on your JARs.
Then, project B can include a dependency to the pom project to get all
of the JARs (transitively) in the classpath when building.

-Olivier

On Wed, 2007-11-28 at 05:01 -0800, S.Murali wrote:
> I have a Project A (util_common) which is a multi-module project which
> generates a zip file during its assembly (which contains all its sub-module
> jars) and i installed  it in the local repository using
> install:install-file.
> 
> Now, I want to add dependency to Project A (util_common) zip file in the
> Project B pom file.  
> <dependency>
> 	<groupId>com.proj.risk</groupId>
> 	<artifactId>util_common</artifactId>			
> 	<version>1.0</version>
> 	<type>zip</type>
> </dependency>
> 
> However, the dependency to the jar files inside the util_common zip file is
> not getting resolved from Project B.
> 
> I  tried unpack all the jar files during the assembly phase, so that zip
> file contains the sources of jar files rather individual jar files. But, it
> did not work.
> 
> I think the problem might be due to some classpath issue while referencing,
> though not sure. 
> 
> I would like to know if this is possible in maven?  If so, how?
> 
> Thanks in advance, Murali
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Issue in dependency resolution to zip file (having muliple jars)

Posted by "S.Murali" <hi...@gmail.com>.
Thanks Nicole.  This works for me now using the transitive dependecies as
suggested you and Olivier - so no need to create a zip.  Actually we have
multiple projects (X, Y, Z etc..) which need to depend on Project A
(util_common) and each one might need to depend on different version of
Project A.  As I mentioned before Project A contains mulitple sub-projects
(jars) which we want to represent as a single artifact (zip file) rather 
each project directly referencing sub-project jars.
I think this might be best solution design wise for this problem.  Let know
if you feel otherwise.

Thanks, Murali




Nicole Lacoste wrote:
> 
> Murali
> 
> I think you need to also install the jars of the sub-modules in the local
> repository.  Then you can either depend directly on the sub-modules in
> Project B.  Or better yet make a new sub-project of Project A that makes
> the
> zip, leaving Project A to be just an aggregate pom. This new sub project
> must depend on the submodules it zips, so depending on it will then you'll
> get the transitive dependencies.  Is there a good reason that you are
> creating the zip?
> 
> Nicole
> 
> 
> On 28/11/2007, S.Murali <hi...@gmail.com> wrote:
>>
>>
>> I have a Project A (util_common) which is a multi-module project which
>> generates a zip file during its assembly (which contains all its
>> sub-module
>> jars) and i installed  it in the local repository using
>> install:install-file.
>>
>> Now, I want to add dependency to Project A (util_common) zip file in the
>> Project B pom file.
>> <dependency>
>>        <groupId>com.proj.risk</groupId>
>>        <artifactId>util_common</artifactId>
>>        <version>1.0</version>
>>        <type>zip</type>
>> </dependency>
>>
>> However, the dependency to the jar files inside the util_common zip file
>> is
>> not getting resolved from Project B.
>>
>> I  tried unpack all the jar files during the assembly phase, so that zip
>> file contains the sources of jar files rather individual jar files. But,
>> it
>> did not work.
>>
>> I think the problem might be due to some classpath issue while
>> referencing,
>> though not sure.
>>
>> I would like to know if this is possible in maven?  If so, how?
>>
>> Thanks in advance, Murali
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Issue-in-dependency-resolution-to-zip-file-%28having-muliple-jars%29-tf4888364s177.html#a13991793
>> 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/Issue-in-dependency-resolution-to-zip-file-%28having-muliple-jars%29-tf4888364s177.html#a14020712
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: Issue in dependency resolution to zip file (having muliple jars)

Posted by Nicole Lacoste <ni...@gmail.com>.
Murali

I think you need to also install the jars of the sub-modules in the local
repository.  Then you can either depend directly on the sub-modules in
Project B.  Or better yet make a new sub-project of Project A that makes the
zip, leaving Project A to be just an aggregate pom. This new sub project
must depend on the submodules it zips, so depending on it will then you'll
get the transitive dependencies.  Is there a good reason that you are
creating the zip?

Nicole


On 28/11/2007, S.Murali <hi...@gmail.com> wrote:
>
>
> I have a Project A (util_common) which is a multi-module project which
> generates a zip file during its assembly (which contains all its
> sub-module
> jars) and i installed  it in the local repository using
> install:install-file.
>
> Now, I want to add dependency to Project A (util_common) zip file in the
> Project B pom file.
> <dependency>
>        <groupId>com.proj.risk</groupId>
>        <artifactId>util_common</artifactId>
>        <version>1.0</version>
>        <type>zip</type>
> </dependency>
>
> However, the dependency to the jar files inside the util_common zip file
> is
> not getting resolved from Project B.
>
> I  tried unpack all the jar files during the assembly phase, so that zip
> file contains the sources of jar files rather individual jar files. But,
> it
> did not work.
>
> I think the problem might be due to some classpath issue while
> referencing,
> though not sure.
>
> I would like to know if this is possible in maven?  If so, how?
>
> Thanks in advance, Murali
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Issue-in-dependency-resolution-to-zip-file-%28having-muliple-jars%29-tf4888364s177.html#a13991793
> 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
>
>