You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Todd Nine <to...@gmail.com> on 2007/02/28 20:30:08 UTC

Help updating batch script during assembly

Hi all,
  I have a large standalone distribution I'm zipping up with the assembler.
It's using a self executing jar, and has both a batch script and a shell
script that use "java -jar artifactId-<version>.jar <args>".  Is it possible
to use something similar to sed in the assembler so I can find and replace a
variable in my scripts with the artifact name.  This way we won't have to
manually update the scripts before we package our artifacts, and we can
reduce errors due to version mismatches in the scripts.

Thanks,
Todd

Re: Help updating batch script during assembly

Posted by Todd Nine <to...@gmail.com>.
Thanks guys,
  I believe I have also found another potential solution.  According to the
assembler plugin documentation here.

http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_fileSet

I should be able to use the following snippet in my fileSet.

<fileSet>
            <directory>src/config</directory>
            <filtered>true</filtered>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>**/**</include>
            </includes>
        </fileSet>

However, it complains about an unrecognized tag when I try to use this.  I'm
using the assembler  plugin 2.1.  Any ides?

On 2/28/07, Greg_Vaughn@countrywide.com <Gr...@countrywide.com> wrote:
>
> It would by default, however, you can modify the maven-resources-plugin
> settings to put, for example, *.bat and *.sh files outside of
> target/classes and therefore not get put in the jar.
>
> More info at http://maven.apache.org/plugins/maven-resources-plugin/
>
> -Greg Vaughn
>
> "Todd Nine" <to...@gmail.com> wrote on 02/28/2007 01:55:39 PM:
>
> > No, but wouldn't they then get inserted into the jar, not into the zip
> file?
> > If not, where is the doc on setting this up?  I couldn't find it
> anywhere.
> >
> > Thanks,
> > Todd
> >
> > On 2/28/07, Wayne Fay <wa...@gmail.com> wrote:
> > >
> > > Any reason your scripts can't live in resources and get filtered, so
> > > the proper values are replaced in the files during the normal Maven
> > > "process-resources" phase?
> > >
> > > Wayne
> > >
> > > On 2/28/07, Todd Nine <to...@gmail.com> wrote:
> > > > Hi all,
> > > >   I have a large standalone distribution I'm zipping up with the
> > > assembler.
> > > > It's using a self executing jar, and has both a batch script and a
> shell
> > > > script that use "java -jar artifactId-<version>.jar <args>".  Is it
> > > possible
> > > > to use something similar to sed in the assembler so I can find and
> > > replace a
> > > > variable in my scripts with the artifact name.  This way we won't
> have
> > > to
> > > > manually update the scripts before we package our artifacts, and we
> can
> > > > reduce errors due to version mismatches in the scripts.
> > > >
> > > > Thanks,
> > > > Todd
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
>
> ======================================================================
> Confidentiality Notice: The information contained in and transmitted with
> this communication is strictly confidential, is intended only for the use of
> the intended recipient, and is the property of Countrywide Financial
> Corporation or its affiliates and subsidiaries.  If you are not the intended
> recipient, you are hereby notified that any use of the information contained
> in or transmitted with the communication or dissemination, distribution, or
> copying of this communication is strictly prohibited by law.  If you have
> received this communication in error, please immediately return this
> communication to the sender and delete the original message and any copy of
> it in your possession.
> ======================================================================
>

Re: Help updating batch script during assembly

Posted by Gr...@Countrywide.Com.
It would by default, however, you can modify the maven-resources-plugin 
settings to put, for example, *.bat and *.sh files outside of 
target/classes and therefore not get put in the jar.

More info at http://maven.apache.org/plugins/maven-resources-plugin/

-Greg Vaughn

"Todd Nine" <to...@gmail.com> wrote on 02/28/2007 01:55:39 PM:

> No, but wouldn't they then get inserted into the jar, not into the zip 
file?
> If not, where is the doc on setting this up?  I couldn't find it 
anywhere.
> 
> Thanks,
> Todd
> 
> On 2/28/07, Wayne Fay <wa...@gmail.com> wrote:
> >
> > Any reason your scripts can't live in resources and get filtered, so
> > the proper values are replaced in the files during the normal Maven
> > "process-resources" phase?
> >
> > Wayne
> >
> > On 2/28/07, Todd Nine <to...@gmail.com> wrote:
> > > Hi all,
> > >   I have a large standalone distribution I'm zipping up with the
> > assembler.
> > > It's using a self executing jar, and has both a batch script and a 
shell
> > > script that use "java -jar artifactId-<version>.jar <args>".  Is it
> > possible
> > > to use something similar to sed in the assembler so I can find and
> > replace a
> > > variable in my scripts with the artifact name.  This way we won't 
have
> > to
> > > manually update the scripts before we package our artifacts, and we 
can
> > > reduce errors due to version mismatches in the scripts.
> > >
> > > Thanks,
> > > Todd
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >

======================================================================
Confidentiality Notice: The information contained in and transmitted with this communication is strictly confidential, is intended only for the use of the intended recipient, and is the property of Countrywide Financial Corporation or its affiliates and subsidiaries.  If you are not the intended recipient, you are hereby notified that any use of the information contained in or transmitted with the communication or dissemination, distribution, or copying of this communication is strictly prohibited by law.  If you have received this communication in error, please immediately return this communication to the sender and delete the original message and any copy of it in your possession.
======================================================================

Re: Help updating batch script during assembly

Posted by Todd Nine <to...@gmail.com>.
No, but wouldn't they then get inserted into the jar, not into the zip file?
If not, where is the doc on setting this up?  I couldn't find it anywhere.

Thanks,
Todd

On 2/28/07, Wayne Fay <wa...@gmail.com> wrote:
>
> Any reason your scripts can't live in resources and get filtered, so
> the proper values are replaced in the files during the normal Maven
> "process-resources" phase?
>
> Wayne
>
> On 2/28/07, Todd Nine <to...@gmail.com> wrote:
> > Hi all,
> >   I have a large standalone distribution I'm zipping up with the
> assembler.
> > It's using a self executing jar, and has both a batch script and a shell
> > script that use "java -jar artifactId-<version>.jar <args>".  Is it
> possible
> > to use something similar to sed in the assembler so I can find and
> replace a
> > variable in my scripts with the artifact name.  This way we won't have
> to
> > manually update the scripts before we package our artifacts, and we can
> > reduce errors due to version mismatches in the scripts.
> >
> > Thanks,
> > Todd
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Help updating batch script during assembly

Posted by Wayne Fay <wa...@gmail.com>.
Any reason your scripts can't live in resources and get filtered, so
the proper values are replaced in the files during the normal Maven
"process-resources" phase?

Wayne

On 2/28/07, Todd Nine <to...@gmail.com> wrote:
> Hi all,
>   I have a large standalone distribution I'm zipping up with the assembler.
> It's using a self executing jar, and has both a batch script and a shell
> script that use "java -jar artifactId-<version>.jar <args>".  Is it possible
> to use something similar to sed in the assembler so I can find and replace a
> variable in my scripts with the artifact name.  This way we won't have to
> manually update the scripts before we package our artifacts, and we can
> reduce errors due to version mismatches in the scripts.
>
> Thanks,
> Todd
>

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