You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Farrukh S. Najmi" <fa...@wellfleetsoftware.com> on 2007/06/14 16:39:26 UTC

How to add file to war META-INF dir

Dear colleagues,

My maven2 war project produces a file under the target tree as part of
the generate-source phase:

    target/somedirectory/META-INF/somefile

How can I include this file under the META-INF directory of the packaged
war as follows:

    META-INF/somefile

Thanks for your help.

-- 
Regards,
Farrukh

Web: http://www.wellfleetsoftware.com



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


Re: How to add file to war META-INF dir

Posted by Alexander Sack <pi...@gmail.com>.
I think he is looking to place file in META-INF not MANIFEST customization -
I could be wrong and that link maybe helpful none the less.

Some suggestions, maybe not the best solution but:

- Use the antrun pluging to copy stuff over before the package phase (I'm
will assume this artifact is generated during compilation) (already
suggested)

- Treat it as an external web resource and then use
http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
to overlay the META-INF directory directly (ugly as sin)

That second one is off the top of my head and I have not tried it...

-aps

On 6/14/07, Eric Redmond <er...@gmail.com> wrote:
>
>
> http://maven.apache.org/plugins/maven-war-plugin/examples/war-manifest-guide.html
>
> Eric
>
> On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
> >
> >
> > Hi Eric,
> >
> > The docs are not obvious to me. Do I need to write code for this?
> > If not, can you give an example please. Thanks.
> >
> > Eric Redmond wrote:
> > > I'm confused... why can't you use the "archive" configuration of the
> > > "war:war" goal?
> > >
> > > http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
> > >
> > > Eric
> > >
> > > On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
> > >>
> > >>
> > >> Thanks. I guess that is what I will have to do.
> > >>
> > >> I have filed the following issue requesting this RFE:
> > >>
> > >> <http://jira.codehaus.org/browse/MWAR-105>
> > >>
> > >> Thanks very much for all your help.
> > >>
> > >> Wayne Fay wrote:
> > >> > If you can't control where it is being created, perhaps you should
> > use
> > >> > the antrun plugin to copy the file to where you need it after it
> has
> > >> > been generated.
> > >> >
> > >> > Wayne
> > >> >
> > >> > On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
> > >> >> Alexander Sack wrote:
> > >> >> > Can you give an example?  Also, why can't you change where the
> > >> >> target is
> > >> >> > produced?
> > >> >>
> > >> >> Hi Alexander,
> > >> >>
> > >> >> There is a complex dependency on various plugin and underlying
> > >> libraries
> > >> >> that does not offer much flexibility in where the file is
> produced.
> > >> >>
> > >> >> The example is the one I gave earlier. The generate-sources phase
> > >> >> produces:
> > >> >>
> > >> >> target/jaxws/wsimport/java/META-INF/somefile
> > >> >>
> > >> >> I need the resulting war to have:
> > >> >>
> > >> >> META-INF/somefile
> > >> >>
> > >> >> Thanks for any suggestions.
> >
> >
> > --
> > Regards,
> > Farrukh
> >
> > Web: http://www.wellfleetsoftware.com
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Eric Redmond
> http://www.sonatype.com
>



-- 
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson

Re: How to add file to war META-INF dir

Posted by Eric Redmond <er...@gmail.com>.
http://maven.apache.org/plugins/maven-war-plugin/examples/war-manifest-guide.html

Eric

On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
>
>
> Hi Eric,
>
> The docs are not obvious to me. Do I need to write code for this?
> If not, can you give an example please. Thanks.
>
> Eric Redmond wrote:
> > I'm confused... why can't you use the "archive" configuration of the
> > "war:war" goal?
> >
> > http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
> >
> > Eric
> >
> > On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
> >>
> >>
> >> Thanks. I guess that is what I will have to do.
> >>
> >> I have filed the following issue requesting this RFE:
> >>
> >> <http://jira.codehaus.org/browse/MWAR-105>
> >>
> >> Thanks very much for all your help.
> >>
> >> Wayne Fay wrote:
> >> > If you can't control where it is being created, perhaps you should
> use
> >> > the antrun plugin to copy the file to where you need it after it has
> >> > been generated.
> >> >
> >> > Wayne
> >> >
> >> > On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
> >> >> Alexander Sack wrote:
> >> >> > Can you give an example?  Also, why can't you change where the
> >> >> target is
> >> >> > produced?
> >> >>
> >> >> Hi Alexander,
> >> >>
> >> >> There is a complex dependency on various plugin and underlying
> >> libraries
> >> >> that does not offer much flexibility in where the file is produced.
> >> >>
> >> >> The example is the one I gave earlier. The generate-sources phase
> >> >> produces:
> >> >>
> >> >> target/jaxws/wsimport/java/META-INF/somefile
> >> >>
> >> >> I need the resulting war to have:
> >> >>
> >> >> META-INF/somefile
> >> >>
> >> >> Thanks for any suggestions.
>
>
> --
> Regards,
> Farrukh
>
> Web: http://www.wellfleetsoftware.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://www.sonatype.com

Re: How to add file to war META-INF dir

Posted by "Farrukh S. Najmi" <fa...@wellfleetsoftware.com>.
Hi Eric,

The docs are not obvious to me. Do I need to write code for this?
If not, can you give an example please. Thanks.

Eric Redmond wrote:
> I'm confused... why can't you use the "archive" configuration of the
> "war:war" goal?
>
> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
>
> Eric
>
> On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
>>
>>
>> Thanks. I guess that is what I will have to do.
>>
>> I have filed the following issue requesting this RFE:
>>
>> <http://jira.codehaus.org/browse/MWAR-105>
>>
>> Thanks very much for all your help.
>>
>> Wayne Fay wrote:
>> > If you can't control where it is being created, perhaps you should use
>> > the antrun plugin to copy the file to where you need it after it has
>> > been generated.
>> >
>> > Wayne
>> >
>> > On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
>> >> Alexander Sack wrote:
>> >> > Can you give an example?  Also, why can't you change where the
>> >> target is
>> >> > produced?
>> >>
>> >> Hi Alexander,
>> >>
>> >> There is a complex dependency on various plugin and underlying
>> libraries
>> >> that does not offer much flexibility in where the file is produced.
>> >>
>> >> The example is the one I gave earlier. The generate-sources phase
>> >> produces:
>> >>
>> >> target/jaxws/wsimport/java/META-INF/somefile
>> >>
>> >> I need the resulting war to have:
>> >>
>> >> META-INF/somefile
>> >>
>> >> Thanks for any suggestions.


-- 
Regards,
Farrukh

Web: http://www.wellfleetsoftware.com



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


Re: How to add file to war META-INF dir

Posted by Eric Redmond <er...@gmail.com>.
I'm confused... why can't you use the "archive" configuration of the
"war:war" goal?

http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html

Eric

On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
>
>
> Thanks. I guess that is what I will have to do.
>
> I have filed the following issue requesting this RFE:
>
> <http://jira.codehaus.org/browse/MWAR-105>
>
> Thanks very much for all your help.
>
> Wayne Fay wrote:
> > If you can't control where it is being created, perhaps you should use
> > the antrun plugin to copy the file to where you need it after it has
> > been generated.
> >
> > Wayne
> >
> > On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
> >> Alexander Sack wrote:
> >> > Can you give an example?  Also, why can't you change where the
> >> target is
> >> > produced?
> >>
> >> Hi Alexander,
> >>
> >> There is a complex dependency on various plugin and underlying
> libraries
> >> that does not offer much flexibility in where the file is produced.
> >>
> >> The example is the one I gave earlier. The generate-sources phase
> >> produces:
> >>
> >> target/jaxws/wsimport/java/META-INF/somefile
> >>
> >> I need the resulting war to have:
> >>
> >> META-INF/somefile
> >>
> >> Thanks for any suggestions.
> >>
> >> >
> >> > -aps
> >> >
> >> > On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
> >> >>
> >> >> Thanks Alexandre, but I do not have the option to change the
> >> directory
> >> >> where my file is produced (it is under target tree).
> >> >> This must be a common need to include META-INF files from target
> >> tree?
> >> >> Any other suggestions?
> >> >>
> >> >> Alexandre Touret wrote:
> >> >> > Hello,
> >> >> > probably, you could add the directory META-INF in your resource
> >> >> > directory like
> >> >> >
> >> >> > src/main/resources/META-INF
> >> >> > It should work
> >> >> >
> >> >> > Alexandre
> >> >> >
> >> >> > Farrukh S. Najmi a écrit :
> >> >> >> Dear colleagues,
> >> >> >>
> >> >> >> My maven2 war project produces a file under the target tree as
> >> >> part of
> >> >> >> the generate-source phase:
> >> >> >>
> >> >> >>     target/somedirectory/META-INF/somefile
> >> >> >>
> >> >> >> How can I include this file under the META-INF directory of the
> >> >> packaged
> >> >> >> war as follows:
> >> >> >>
> >> >> >>     META-INF/somefile
> >>
> >>
>
>
> --
> Regards,
> Farrukh
>
> Web: http://www.wellfleetsoftware.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://www.sonatype.com

Re: How to add file to war META-INF dir

Posted by "Farrukh S. Najmi" <fa...@wellfleetsoftware.com>.
Thanks. I guess that is what I will have to do.

I have filed the following issue requesting this RFE:

<http://jira.codehaus.org/browse/MWAR-105>

Thanks very much for all your help.

Wayne Fay wrote:
> If you can't control where it is being created, perhaps you should use
> the antrun plugin to copy the file to where you need it after it has
> been generated.
>
> Wayne
>
> On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
>> Alexander Sack wrote:
>> > Can you give an example?  Also, why can't you change where the
>> target is
>> > produced?
>>
>> Hi Alexander,
>>
>> There is a complex dependency on various plugin and underlying libraries
>> that does not offer much flexibility in where the file is produced.
>>
>> The example is the one I gave earlier. The generate-sources phase
>> produces:
>>
>> target/jaxws/wsimport/java/META-INF/somefile
>>
>> I need the resulting war to have:
>>
>> META-INF/somefile
>>
>> Thanks for any suggestions.
>>
>> >
>> > -aps
>> >
>> > On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
>> >>
>> >> Thanks Alexandre, but I do not have the option to change the
>> directory
>> >> where my file is produced (it is under target tree).
>> >> This must be a common need to include META-INF files from target
>> tree?
>> >> Any other suggestions?
>> >>
>> >> Alexandre Touret wrote:
>> >> > Hello,
>> >> > probably, you could add the directory META-INF in your resource
>> >> > directory like
>> >> >
>> >> > src/main/resources/META-INF
>> >> > It should work
>> >> >
>> >> > Alexandre
>> >> >
>> >> > Farrukh S. Najmi a écrit :
>> >> >> Dear colleagues,
>> >> >>
>> >> >> My maven2 war project produces a file under the target tree as
>> >> part of
>> >> >> the generate-source phase:
>> >> >>
>> >> >>     target/somedirectory/META-INF/somefile
>> >> >>
>> >> >> How can I include this file under the META-INF directory of the
>> >> packaged
>> >> >> war as follows:
>> >> >>
>> >> >>     META-INF/somefile
>>
>>


-- 
Regards,
Farrukh

Web: http://www.wellfleetsoftware.com



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


Re: How to add file to war META-INF dir

Posted by Wayne Fay <wa...@gmail.com>.
If you can't control where it is being created, perhaps you should use
the antrun plugin to copy the file to where you need it after it has
been generated.

Wayne

On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
> Alexander Sack wrote:
> > Can you give an example?  Also, why can't you change where the target is
> > produced?
>
> Hi Alexander,
>
> There is a complex dependency on various plugin and underlying libraries
> that does not offer much flexibility in where the file is produced.
>
> The example is the one I gave earlier. The generate-sources phase produces:
>
> target/jaxws/wsimport/java/META-INF/somefile
>
> I need the resulting war to have:
>
> META-INF/somefile
>
> Thanks for any suggestions.
>
> >
> > -aps
> >
> > On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
> >>
> >> Thanks Alexandre, but I do not have the option to change the directory
> >> where my file is produced (it is under target tree).
> >> This must be a common need to include META-INF files from target tree?
> >> Any other suggestions?
> >>
> >> Alexandre Touret wrote:
> >> > Hello,
> >> > probably, you could add the directory META-INF in your resource
> >> > directory like
> >> >
> >> > src/main/resources/META-INF
> >> > It should work
> >> >
> >> > Alexandre
> >> >
> >> > Farrukh S. Najmi a écrit :
> >> >> Dear colleagues,
> >> >>
> >> >> My maven2 war project produces a file under the target tree as
> >> part of
> >> >> the generate-source phase:
> >> >>
> >> >>     target/somedirectory/META-INF/somefile
> >> >>
> >> >> How can I include this file under the META-INF directory of the
> >> packaged
> >> >> war as follows:
> >> >>
> >> >>     META-INF/somefile
>
>
> --
> Regards,
> Farrukh
>
> Web: http://www.wellfleetsoftware.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: How to add file to war META-INF dir

Posted by Alexandre Touret <at...@free.fr>.
I guess that the easier way to resolve this issue is to create a ant 
script which might be started after this build under the maven-ant-plugin .

Alexandre

Farrukh S. Najmi a écrit :
> Alexander Sack wrote:
>   
>> Can you give an example?  Also, why can't you change where the target is
>> produced?
>>     
>
> Hi Alexander,
>
> There is a complex dependency on various plugin and underlying libraries
> that does not offer much flexibility in where the file is produced.
>
> The example is the one I gave earlier. The generate-sources phase produces:
>
> target/jaxws/wsimport/java/META-INF/somefile
>
> I need the resulting war to have:
>
> META-INF/somefile
>
> Thanks for any suggestions.
>
>   
>> -aps
>>
>> On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
>>     
>>> Thanks Alexandre, but I do not have the option to change the directory
>>> where my file is produced (it is under target tree).
>>> This must be a common need to include META-INF files from target tree?
>>> Any other suggestions?
>>>
>>> Alexandre Touret wrote:
>>>       
>>>> Hello,
>>>> probably, you could add the directory META-INF in your resource
>>>> directory like
>>>>
>>>> src/main/resources/META-INF
>>>> It should work
>>>>
>>>> Alexandre
>>>>
>>>> Farrukh S. Najmi a écrit :
>>>>         
>>>>> Dear colleagues,
>>>>>
>>>>> My maven2 war project produces a file under the target tree as
>>>>>           
>>> part of
>>>       
>>>>> the generate-source phase:
>>>>>
>>>>>     target/somedirectory/META-INF/somefile
>>>>>
>>>>> How can I include this file under the META-INF directory of the
>>>>>           
>>> packaged
>>>       
>>>>> war as follows:
>>>>>
>>>>>     META-INF/somefile
>>>>>           
>
>
>   


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


Re: How to add file to war META-INF dir

Posted by "Farrukh S. Najmi" <fa...@wellfleetsoftware.com>.
Alexander Sack wrote:
> Can you give an example?  Also, why can't you change where the target is
> produced?

Hi Alexander,

There is a complex dependency on various plugin and underlying libraries
that does not offer much flexibility in where the file is produced.

The example is the one I gave earlier. The generate-sources phase produces:

target/jaxws/wsimport/java/META-INF/somefile

I need the resulting war to have:

META-INF/somefile

Thanks for any suggestions.

>
> -aps
>
> On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
>>
>> Thanks Alexandre, but I do not have the option to change the directory
>> where my file is produced (it is under target tree).
>> This must be a common need to include META-INF files from target tree?
>> Any other suggestions?
>>
>> Alexandre Touret wrote:
>> > Hello,
>> > probably, you could add the directory META-INF in your resource
>> > directory like
>> >
>> > src/main/resources/META-INF
>> > It should work
>> >
>> > Alexandre
>> >
>> > Farrukh S. Najmi a écrit :
>> >> Dear colleagues,
>> >>
>> >> My maven2 war project produces a file under the target tree as
>> part of
>> >> the generate-source phase:
>> >>
>> >>     target/somedirectory/META-INF/somefile
>> >>
>> >> How can I include this file under the META-INF directory of the
>> packaged
>> >> war as follows:
>> >>
>> >>     META-INF/somefile


-- 
Regards,
Farrukh

Web: http://www.wellfleetsoftware.com



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


Re: How to add file to war META-INF dir

Posted by Alexander Sack <pi...@gmail.com>.
Can you give an example?  Also, why can't you change where the target is
produced?

-aps

On 6/14/07, Farrukh S. Najmi <fa...@wellfleetsoftware.com> wrote:
>
> Thanks Alexandre, but I do not have the option to change the directory
> where my file is produced (it is under target tree).
> This must be a common need to include META-INF files from target tree?
> Any other suggestions?
>
> Alexandre Touret wrote:
> > Hello,
> > probably, you could add the directory META-INF in your resource
> > directory like
> >
> > src/main/resources/META-INF
> > It should work
> >
> > Alexandre
> >
> > Farrukh S. Najmi a écrit :
> >> Dear colleagues,
> >>
> >> My maven2 war project produces a file under the target tree as part of
> >> the generate-source phase:
> >>
> >>     target/somedirectory/META-INF/somefile
> >>
> >> How can I include this file under the META-INF directory of the
> packaged
> >> war as follows:
> >>
> >>     META-INF/somefile
> >>
> >> Thanks for your help.
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
>
> --
> Regards,
> Farrukh
>
> Web: http://www.wellfleetsoftware.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson

Re: How to add file to war META-INF dir

Posted by "Farrukh S. Najmi" <fa...@wellfleetsoftware.com>.
Thanks Alexandre, but I do not have the option to change the directory
where my file is produced (it is under target tree).
This must be a common need to include META-INF files from target tree?
Any other suggestions?

Alexandre Touret wrote:
> Hello,
> probably, you could add the directory META-INF in your resource
> directory like
>
> src/main/resources/META-INF
> It should work
>
> Alexandre
>
> Farrukh S. Najmi a écrit :
>> Dear colleagues,
>>
>> My maven2 war project produces a file under the target tree as part of
>> the generate-source phase:
>>
>>     target/somedirectory/META-INF/somefile
>>
>> How can I include this file under the META-INF directory of the packaged
>> war as follows:
>>
>>     META-INF/somefile
>>
>> Thanks for your help.
>>
>>   
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


-- 
Regards,
Farrukh

Web: http://www.wellfleetsoftware.com



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


Re: How to add file to war META-INF dir

Posted by Alexandre Touret <at...@free.fr>.
Hello,
probably, you could add the directory META-INF in your resource 
directory like

src/main/resources/META-INF
It should work

Alexandre

Farrukh S. Najmi a écrit :
> Dear colleagues,
>
> My maven2 war project produces a file under the target tree as part of
> the generate-source phase:
>
>     target/somedirectory/META-INF/somefile
>
> How can I include this file under the META-INF directory of the packaged
> war as follows:
>
>     META-INF/somefile
>
> Thanks for your help.
>
>   


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