You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Hendrik Neumann <th...@googlemail.com> on 2006/01/21 08:56:01 UTC

Howto add faces-config.xml file to /META-INF in a jar to create a deployable jsf component?

Hi List,

I have some problems to create a jar file which contains an
"out-of-the-box" usable JSF-Component.

I analyzed the jar-file from myfaces-all.jar and I noticed that you
put the tld and the faces-config.xml into the /META-INF directory of
the jar file. Is this step needed to let a servlet-container use the
component out of the box? So that you don't need to add the tld and
the faces-config of myfaces in the web.xml of your current project?
And how did you do this? I tried it the ugly way by creating a jar
file with Apache Maven and then using commands like "jar uf
mycomponents.jar META-INF/faces-config.xml" but this it not working
(Tomcat gives me a java.io.FileNotFoundException when it tries to
unpack the faces-config.xml and the webapplication is totally
unusable).

How can I create an out of the box usable jsf-jar-file with Maven?
What am I doing wrong?

--
Mit freundlichen Grüßen / Greetings,
Hendrik Neumann; Ruhr-University of Bochum

Re: Howto add faces-config.xml file to /META-INF in a jar to create a deployable jsf component?

Posted by Cagatay Civici <ca...@gmail.com>.
Hi,

Alternatively, if ant is employed, the following task should do the work.

    <target name="distribute" depends="compile">
         <jar destfile="${distribution}/yourcoomponentname.jar"
basedir="${classes}">
             <metainf dir="${resources}" />
         </jar>
     </target>

This task creates a jar file, put the files under classes folder and puts
the files like tld and face-config under meta-inf.

Regards,

Cagatay,

On 1/21/06, Hendrik Neumann <th...@googlemail.com> wrote:
>
> I just noticed that it seems to be very easy: Using Apache Maven you
> just need to create a META-INF folder in your resource-folder. Every
> file placed in this directory will be copied into the META-INF folder
> of the jar. To create an out of the box usable JSF-component JAR
> archive you need to place the tld and a minimal faces-config.xml into
> /META-INF.
>
> Now I think I know everything I need to know...
>
> 2006/1/21, Hendrik Neumann <th...@googlemail.com>:
> > Hi List,
> >
> > I have some problems to create a jar file which contains an
> > "out-of-the-box" usable JSF-Component.
> >
> > I analyzed the jar-file from myfaces-all.jar and I noticed that you
> > put the tld and the faces-config.xml into the /META-INF directory of
> > the jar file. Is this step needed to let a servlet-container use the
> > component out of the box? So that you don't need to add the tld and
> > the faces-config of myfaces in the web.xml of your current project?
> > And how did you do this? I tried it the ugly way by creating a jar
> > file with Apache Maven and then using commands like "jar uf
> > mycomponents.jar META-INF/faces-config.xml" but this it not working
> > (Tomcat gives me a java.io.FileNotFoundException when it tries to
> > unpack the faces-config.xml and the webapplication is totally
> > unusable).
> >
> > How can I create an out of the box usable jsf-jar-file with Maven?
> > What am I doing wrong?
> >
> > --
> > Mit freundlichen Grüßen / Greetings,
> > Hendrik Neumann; Ruhr-University of Bochum
> >
>
>
> --
> Mit freundlichen Grüßen / Greetings,
> Hendrik Neumann; Ruhr-University of Bochum
>

Re: Howto add faces-config.xml file to /META-INF in a jar to create a deployable jsf component?

Posted by Hendrik Neumann <th...@googlemail.com>.
I just noticed that it seems to be very easy: Using Apache Maven you
just need to create a META-INF folder in your resource-folder. Every
file placed in this directory will be copied into the META-INF folder
of the jar. To create an out of the box usable JSF-component JAR
archive you need to place the tld and a minimal faces-config.xml into
/META-INF.

Now I think I know everything I need to know...

2006/1/21, Hendrik Neumann <th...@googlemail.com>:
> Hi List,
>
> I have some problems to create a jar file which contains an
> "out-of-the-box" usable JSF-Component.
>
> I analyzed the jar-file from myfaces-all.jar and I noticed that you
> put the tld and the faces-config.xml into the /META-INF directory of
> the jar file. Is this step needed to let a servlet-container use the
> component out of the box? So that you don't need to add the tld and
> the faces-config of myfaces in the web.xml of your current project?
> And how did you do this? I tried it the ugly way by creating a jar
> file with Apache Maven and then using commands like "jar uf
> mycomponents.jar META-INF/faces-config.xml" but this it not working
> (Tomcat gives me a java.io.FileNotFoundException when it tries to
> unpack the faces-config.xml and the webapplication is totally
> unusable).
>
> How can I create an out of the box usable jsf-jar-file with Maven?
> What am I doing wrong?
>
> --
> Mit freundlichen Grüßen / Greetings,
> Hendrik Neumann; Ruhr-University of Bochum
>


--
Mit freundlichen Grüßen / Greetings,
Hendrik Neumann; Ruhr-University of Bochum