Hi,

This is what I have in mind about that...

But first you should know how to configure the compiler plugin to use enable debug. I think the parameter debug is already deprecated. More info on compiler plugin configurations can be found here: http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html

Anyway, the process include calling mvn twice: once to get the normal build package and another time with the debug enabled.

The first package is easy as you do not need to set any configurations for the compiler plugin... so calling "mvn package" will give you the desired archive without the debug info.

To generate the second package, you can use profiles and put in the compiler configuration the arguments you want. And to make sure that the second package will not overwrite the previously generated package, you can also put a <finalName> tag in your profile so that the generated archive will have a different name, and therefore won't overwrite your previous archive. More info on profiles can be found here: http://maven.apache.org/guides/introduction/introduction-to-profiles.html



Paolo Perrucci wrote:

Hi Edwin,

this is an extract of my build.xml that create the "debug" jar:

<target name="jar_debug" depends="clean">
<javac srcdir="src" destdir="${build}" debug="on" optimize="off" classpathref="classpath"/>
<jar jarfile="util_d.jar">
 <fileset dir="${build}" includes="**/*.class"/>
</jar>
</target>

As you can see I use the javac ant task option to include/exclude the debug infos.

Paolo

Edwin Punzalan ha scritto:

Thanks, I get what you want to do.

But how do you produce the two different jars? How do you set the "different options" that you said with ant? is there a config file or a command-line argument that "build_release" and "build_debug" uses?


Paolo Perrucci wrote:

Hi Edwin,

in my existing ant build I have two tasks that compile the same sources (with different options) and create the jar files. I have a task named "build" that call sequentially the tasks "build_release" and "build_debug". After calling the "build" task I have two jars: <project_name>.jar and <project_name_d>.jar. The "_d" is used for the jar file containing class files compiled with debug infos.

Thank you
Paolo


Edwin Punzalan ha scritto:


Hi,


In your ant build, how do you setup your two jars?
Is there a config file that should be changed for the debug infos?

Or do you need to compile once for two jars? or do you recompile for the second jar?

Or both?

Please provide more info and maybe we can help.

^_^



Paolo Perrucci wrote:

Hi all,

to experiment with m2 I'm trying to define the pom for a "legacy" project build with ant. The existing ant build process create two jar: with and without debug infos. How can I use m2 to create the same jars without using the old ant build?

Thanks
Paolo




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to