Seeking multi-module project best practice

285 views
Skip to first unread message

Farrukh Najmi

unread,
Nov 22, 2010, 9:40:49 PM11/22/10
to pyx4me-users

I have a multi-module project that has two major outputs, a war file
for a webapp and a zip file for a java webstart distribution. The
modules for both these two outputs need to be able to produce
obfuscated and unobfuscated outputs. All the other modules in my multi-
module project are dependencies to the two main deliverables and the
two need to be able to produce obfuscated and unobfuscated outputs.

Are there any best practices on how to do that for multi-module
projects? I would be grateful for any experience that people can
share. Thanks.

Vlad Skarzhevskyy

unread,
Nov 22, 2010, 10:42:56 PM11/22/10
to pyx4me...@googlegroups.com
The main usage I created this plugin is for applet in microemu.org. The same may apply to webstart apps. See how we did it. Keep in mind that in microemu we expose cldc and midp api 
See <attachArtifactClassifier>4applet<attachArtifactClassifier> in project poms

If you creating each module obfuscated you would need to very careful with API exposed by each module. If you follow OO programming model the obfucated result would be very predictable.

Vlad



--
You received this message because you are subscribed to the Google Groups "pyx4me-users" group.
To post to this group, send email to pyx4me...@googlegroups.com.
To unsubscribe from this group, send email to pyx4me-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyx4me-users?hl=en.


Farrukh Najmi

unread,
Nov 23, 2010, 9:29:41 AM11/23/10
to pyx4me-users
Here is what I am struggling with when it comes to multi-module
projects.

I am looking for a way that when a build my multi-module project the
following happens for each project:

* Each jar module produces a normal jar like <module>-<version>.jar
(normal behavior)
* Each jar module also produces an obfuscated jar like <module>-
<version>-obfuscated.jar. Ideally this would somehow use the maven
classifier mechanism with classifier "obfuscated"
* Each jar module installs both the normal and obfuscated jars to the
local maven repo on the install target
* Any other modules in the multi-module project that depend on the
obfuscated module again build two jars (normal and obfuscated). The
obfuscated one depends upon the obfuscated version of teh depenency
jar while the normal one depends upon the normal version of the
dependency jar

I am curious if above is good from the perspective of the multi-module
developer and above all whether above is feasible with proguard-maven-
plugin.

The alternative seems to be do one of the following:

1. Have one new project that depends upon all the other modules of the
project and obfuscates them and packages them in a single obfuscated
jar.
2. Have a shadow obfuscated module for each module in your project.
The normal modules work as normal while the obfuscated modules depend
on obfuscated dependencies

I would be grateful if you and other forum members can share your
thoughts on above questions.

On Nov 22, 10:42 pm, Vlad Skarzhevskyy <skarzhevs...@gmail.com> wrote:
> The main usage I created this plugin is for applet in microemu.org. The same
> may apply to webstart apps. See how we did it. Keep in mind that in microemu
> we expose cldc and midp api
> See <attachArtifactClassifier>4applet<attachArtifactClassifier> in project
> poms
>
> If you creating each module obfuscated you would need to very careful with
> API exposed by each module. If you follow OO programming model the obfucated
> result would be very predictable.
>
> Vlad
>
> On Mon, Nov 22, 2010 at 9:40 PM, Farrukh Najmi <farrukh.n...@gmail.com>wrote:
>
>
>
> > I have a multi-module project that has two major outputs, a war file
> > for a webapp and a zip file for a java webstart distribution. The
> > modules for both these two outputs need to be able to produce
> > obfuscated and unobfuscated outputs. All the other modules in my multi-
> > module project are dependencies to the two main deliverables and the
> > two need to be able to produce obfuscated and unobfuscated outputs.
>
> > Are there any best practices on how to do that for multi-module
> > projects? I would be grateful for any experience that people can
> > share. Thanks.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "pyx4me-users" group.
> > To post to this group, send email to pyx4me...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > pyx4me-users...@googlegroups.com<pyx4me-users%2Bunsu...@googlegroups.com>
> > .

Mikhail Zemlyanukha

unread,
Nov 23, 2010, 12:14:34 PM11/23/10
to pyx4me...@googlegroups.com
Hello all,

I tried to use maven in my own J2ME projects for some time (used ant
before that, but was impressed by maven repository concept, so decided
to try maven).

Can't say why, but adding something to maven pom file often was a
problem for me, to find what configuration options particular plugin
has, or something like that. When I came to a need to generate several
artifacts for a goal, I was not able to understand how to manage that
properly (what I understood that it was not in line with maven
concepts), so I gave up.

Another problem was that maven claims to have 'short config (pom) file
to be able to concentrate on build workflow, instead of writing large
ant scripts'. After some time I started realizing that my pom files
are becoming not very small, being filled in with 'configuration
options', which were hard for me to track properly, so I decided that
ant script is a smaller pain.

Recently I found Apache Ivy http://ant.apache.org/ivy/ which adds
maven repository manager to ant (it is an addon to ant, may be used as
a task), and I liked it, and decided to start using it, because it
adds that I liked in maven (repository management) to what I'm able to
understand in ant. There is no problem to generate several artifacts
in one task in ant ivy.

Again, I can't say that I'm right here, may be just my brain is too
weak for maven )) MicroEmulator always was a sample of an excellent
maven project for me, and actually I noticed maven in ME project.

Regards,
Mike

> To unsubscribe from this group, send email to pyx4me-users...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages