You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dave Comeau <DC...@xenos.com> on 2006/05/16 22:32:58 UTC

Multi modules: project-jar and project-obfuscated-jar help

I'm trying to design a multi-module project to do a variety of steps that I
currently do in my existing Ant build system, and was previously given some
advice to setup one module to create the standard jar artifact, and then
create another module (which has a dependency on the jar module) to create
the obfuscated jar.

Being new to Maven, I can't see how to do this.  In theory I will want the
project-ofuscated-jar to access (and unpackage?) the project-jar's freshly
created jar file and then obfuscate the classes using antrun or a custom
plugin.

I'm hoping someone can shed some light on how this is actually done.  I
can't find any documentation on multi-modules that explains the relationship
between modules in the context that I need.

Here are my questions:

1) I assume that by M2 design, project-obfuscated-jar should not directly
access the classes/ in project-jar.  Instead it should access the
project-jar JAR artifact.  Is this correct?

2) Would project-jar's jar artifact first need to be deployed to the
repository before the project-obfuscated-jar can access it?

3) Assume that project-obfuscated-jar uses antrun to feed the classes
produced by project-jar into the obfuscator.  How do I directly reference
project-jar's JAR file?

4) Is it bad practice to reference peer projects/modules using "../.." type
references?

5) Is there any documentation/references on multi-modules outside of the
typical use cases where a multi-module project is just a set of projects
each with their own source tree?  I feel I am trying to apply the
multi-module functionality to a more specialized use case that is certainly
within the capabilities of Maven, but it's not typical and the documentation
hasn't expanded beyond the mainstream use cases yet.

Thank you for your help
DaveC




Re: Multi modules: project-jar and project-obfuscated-jar help

Posted by Bruno Patini Furtado <bp...@gmail.com>.
I'll help you with what I can :)


On 5/16/06, Dave Comeau <DC...@xenos.com> wrote:
>
>
> I'm trying to design a multi-module project to do a variety of steps that
> I
> currently do in my existing Ant build system, and was previously given
> some
> advice to setup one module to create the standard jar artifact, and then
> create another module (which has a dependency on the jar module) to create
> the obfuscated jar.
>
> Being new to Maven, I can't see how to do this.  In theory I will want the
> project-ofuscated-jar to access (and unpackage?) the project-jar's freshly
> created jar file and then obfuscate the classes using antrun or a custom
> plugin.
>
> I'm hoping someone can shed some light on how this is actually done.  I
> can't find any documentation on multi-modules that explains the
> relationship
> between modules in the context that I need.
>
> Here are my questions:
>
> 1) I assume that by M2 design, project-obfuscated-jar should not directly
> access the classes/ in project-jar.  Instead it should access the
> project-jar JAR artifact.  Is this correct?
>
> 2) Would project-jar's jar artifact first need to be deployed to the
> repository before the project-obfuscated-jar can access it?


You just deploy a artifact to a given repository to other developers, whose
projects depend on it, obtain its latest version. The deploy operation is
only related to Maven Repositories and their sole purpose (as I've
understood) is to keep artifacts and its versions in a central place for
developers to download (using maven obviously) through the dependency
declaration.


3) Assume that project-obfuscated-jar uses antrun to feed the classes
> produced by project-jar into the obfuscator.  How do I directly reference
> project-jar's JAR file?
>
> 4) Is it bad practice to reference peer projects/modules using "../.."
> type
> references?
>
> 5) Is there any documentation/references on multi-modules outside of the
> typical use cases where a multi-module project is just a set of projects
> each with their own source tree?  I feel I am trying to apply the
> multi-module functionality to a more specialized use case that is
> certainly
> within the capabilities of Maven, but it's not typical and the
> documentation
> hasn't expanded beyond the mainstream use cases yet.
>
> Thank you for your help
> DaveC
>
>
>
>
>


-- 
"Minds are like parachutes, they work best when open."

Bruno Patini Furtado
Software Developer
webpage: http://bpfurtado.net
software development blog: http://bpfurtado.livejournal.com

Re: Multi modules: project-jar and project-obfuscated-jar help

Posted by dan tran <da...@gmail.com>.
On 5/16/06, Dave Comeau <DC...@xenos.com> wrote:
>
>
> I'm trying to design a multi-module project to do a variety of steps that
> I
> currently do in my existing Ant build system, and was previously given
> some
> advice to setup one module to create the standard jar artifact, and then
> create another module (which has a dependency on the jar module) to create
> the obfuscated jar.
>
> Being new to Maven, I can't see how to do this.  In theory I will want the
> project-ofuscated-jar to access (and unpackage?) the project-jar's freshly
> created jar file and then obfuscate the classes using antrun or a custom
> plugin.
>
> I'm hoping someone can shed some light on how this is actually done.  I
> can't find any documentation on multi-modules that explains the
> relationship
> between modules in the context that I need.
>
> Here are my questions:
>
> 1) I assume that by M2 design, project-obfuscated-jar should not directly
> access the classes/ in project-jar.  Instead it should access the
> project-jar JAR artifact.  Is this correct?


Maven 2 now allows artifact classifier type, ie you can deploy mulitple
artifacts under one project.
So I dont see why not apply to your use case since it is much simpler.

So you need a use antrun to do the obfuscation and use
build-helper-maven-plugin to help with deploy thru attach goal.

2) Would project-jar's jar artifact first need to be deployed to the
> repository before the project-obfuscated-jar can access it?
>
> 3) Assume that project-obfuscated-jar uses antrun to feed the classes
> produced by project-jar into the obfuscator.  How do I directly reference
> project-jar's JAR file?
>
> 4) Is it bad practice to reference peer projects/modules using "../.."
> type
> references?
>
> 5) Is there any documentation/references on multi-modules outside of the
> typical use cases where a multi-module project is just a set of projects
> each with their own source tree?  I feel I am trying to apply the
> multi-module functionality to a more specialized use case that is
> certainly
> within the capabilities of Maven, but it's not typical and the
> documentation
> hasn't expanded beyond the mainstream use cases yet.
>
> Thank you for your help
> DaveC
>
>
>
>
>