You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Zoltan Farkas <zo...@daxtechnologies.com> on 2008/10/08 18:32:51 UTC

Creating a self extracting archive with the assembly plugin

I am migrating my maven projects from m1 to m2,
and in m1 for deployment I was creating self extracting archives by 
concatenating a shell script with the archive.

the shell script was like:

#!/bin/ksh
port=`uname`
case $port in
    "HP-UX") TAR="tar"
         TAIL="tail -n"
              ;;
    "SunOS") TAR="/usr/sfw/bin/gtar"
         if test -f "$TAR"
         then
        print "gnu tar available"
         else
        print "gnu tar unavailable using system default"
        TAR="tar"
         fi
         TAIL="tail"
            ;;
    "Linux") TAR="tar"
         TAIL="tail -n"
            ;;
          *) TAR ="tar"
         TAIL="tail"
            ;;
esac

   ............................instalation script pre 
unarch.........................

   SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0`
   ${TAIL} +$SKIP $0 | gzip -dc | (cd $OPTIMA_HOME ; $TAR xvf -)

     ............................instalation script post 
unarch.........................

  __ARCHIVE_FOLLOWS__


this was very useful in simplifying the installation/deployment 
procedure of my application.

Is it possible to do this with the assembly plugin? If not what is the 
simplest/best way to do this?

thanks

--zoly


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


Re: Creating a self extracting archive with the assembly plugin

Posted by Brett Porter <br...@gmail.com>.
You should create the assembly as normal, then use antrun to
concatenate the two files into a new one. The build helper can be used
to attach this new file for deployment if needed.

- Brett

2008/10/9 Zoltan Farkas <zo...@daxtechnologies.com>:
> I am migrating my maven projects from m1 to m2,
> and in m1 for deployment I was creating self extracting archives by
> concatenating a shell script with the archive.
>
> the shell script was like:
>
> #!/bin/ksh
> port=`uname`
> case $port in
>   "HP-UX") TAR="tar"
>        TAIL="tail -n"
>             ;;
>   "SunOS") TAR="/usr/sfw/bin/gtar"
>        if test -f "$TAR"
>        then
>       print "gnu tar available"
>        else
>       print "gnu tar unavailable using system default"
>       TAR="tar"
>        fi
>        TAIL="tail"
>           ;;
>   "Linux") TAR="tar"
>        TAIL="tail -n"
>           ;;
>         *) TAR ="tar"
>        TAIL="tail"
>           ;;
> esac
>
>  ............................instalation script pre
> unarch.........................
>
>  SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0`
>  ${TAIL} +$SKIP $0 | gzip -dc | (cd $OPTIMA_HOME ; $TAR xvf -)
>
>    ............................instalation script post
> unarch.........................
>
>  __ARCHIVE_FOLLOWS__
>
>
> this was very useful in simplifying the installation/deployment procedure of
> my application.
>
> Is it possible to do this with the assembly plugin? If not what is the
> simplest/best way to do this?
>
> thanks
>
> --zoly
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
Brett Porter
Blog: http://blogs.exist.com/bporter/

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