users@glassfish.java.net

Re: Making 1 jar out of many modules.

From: Sahoo <Sahoo_at_Sun.COM>
Date: Fri, 01 Feb 2008 07:53:36 +0530

That's correct, HK2 supports jar: format only. Have you explored using
maven-assembly-plugin to make a single jar file?

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> Hi,
>
> I am trying to make a single stand_alone.jar with the help of "One-JAR v0.96". The stand_alone.jar will consist out many hk2 module projects.
>
> my ant build.xml
> [i]
> <project name="one-jar-sdk" default="hello">
>
> <property name="one-jar.version" value="0.96" />
> <property name="one-jar.dist.dir" value="${basedir}" />
>
> <property name="build.dir" location="./target" />
>
> <import file="one-jar-ant-task.xml" />
>
> <target name="hello" depends="clean">
>
> <!-- Construct the One-JAR file -->
> <one-jar destfile="${build.dir}/ONE.jar">
> <main jar="./src/main/hk2-0.2-SNAPSHOT.jar" />
> <lib>
> <fileset dir="./src/support" />
> </lib>
> </one-jar>
>
> </target>
>
> <target name="clean">
> <delete file="${build.dir}/ONE.jar" />
> </target>
>
> </project>[/i]
>
>
>
> [b]I always get [/b]
>
> [i]C:\Java_files\workspace\ansh02_test_Baby19\vobs\test\jar\target>java -jar ONE.jar
> Boot: Warning: Unable to locate main/main.jar in the JAR file ONE.jar
> com.sun.enterprise.module.bootstrap.BootException: Don't support packaging onejar:com.sun.enterprise.module.bootstrap.Main.class , please contribute !
> at com.sun.enterprise.module.bootstrap.Main.getBootstrapFile(Main.java:122)
> at com.sun.enterprise.module.bootstrap.Main.start(Main.java:131)
> at com.sun.enterprise.module.bootstrap.Main$1.run(Main.java:70)[/i]
>
> Seems like the main jar doesn't see the other jars that are located in stand_alone.jar/lib/
>
> Maybe someone had an positive experience with this thing?
>
> for those who are not familiar with this software:
> http://one-jar.sourceforge.net/index.php?page=introduction&file=intro
> [Message sent by forum member 'antsh' (antsh)]
>
> http://forums.java.net/jive/thread.jspa?messageID=256893
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>