You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by maven apache <ap...@gmail.com> on 2010/06/10 06:29:12 UTC
maven resources
HI:
I have two maven module:server(jar) and webapp(war).
And the server module is a dependency of webapp.
There are some resources under the server :/src/main/java/org/kk/*.xml, I do
not want these xmls jared to the server.jar. I just want it put under the
webapp/target/app/WEB-INFO/classes.
How to config it?
Re: maven resources
Posted by Anders Hammar <an...@hammar.net>.
I just noticed some weird spelling. It should be
"...already be shipped with the jar OR provide it himself/herself?"
On Thu, Jun 10, 2010 at 09:48, maven apache <ap...@gmail.com> wrote:
> 2010/6/10 Anders Hammar <an...@hammar.net>
>
> > Ok, I think you don't understand what I'm saying. Of course the files
> are
> > required in runtime, but should the user expect it to already be shipped
> > with the jar och provide it himself/herself?
> > Putting the xml files under test/resource will make them available in
> > runtime when testing your server module. This is what you would od if the
> > xml files are not to be shipped with the jar, but you still need a way to
> > test it.
> >
> Thanks, I will try it.
>
> > /Anders
> > On Thu, Jun 10, 2010 at 08:42, maven apache <ap...@gmail.com>
> > wrote:
> >
> > > 2010/6/10 Anders Hammar <an...@hammar.net>
> > >
> > > > First of all, xml files should go under resources/ not java/.
> > Regardless
> > > if
> > > > you have it in the server jar or the webapp war.
> > > >
> > > > Then, this is how you should think: Think Java! How is the server jar
> > > > supposed to be used. Is the user supposed to add the xml files
> > themselves
> > > >
> > > Yes, but these xml filse are not just for tested, then are required in
> > the
> > > runtime.
> > > Also user can add a class(with a xml file together) in the
> > WEB-INFO/classes
> > > to extend the fuction of my web application.
> > > So I do not want them packaged in the server.jar.
> > >
> > > > (then the xml fiels should not be packaged in the server jar) or are
> > the
> > > > xml
> > > > files part of the server implementation (then they go in the server
> > jar)?
> > > > If the xml files shouldn't be packaged in the server jar, you most
> > likely
> > > > you still need a set of them during development/testing. Then you put
> > > that
> > > > set of xml files in src/test/resources/. They will be used during
> unit
> > > > testing but not packaged in the server jar.
> > > >
> > > They are not just for test.
> > >
> > > Now, I have no choice but put the xmls to the server.jar.
> > >
> > > >
> > > > /Anders
> > > > On Thu, Jun 10, 2010 at 07:23, maven apache <ap...@gmail.com>
> > > > wrote:
> > > >
> > > > > What is going on is that under my package each class need a xml
> file.
> > > > > If I put these xmls to the webapp/src/resources folder,it is not
> > > > convenient
> > > > > for development in my IDE.
> > > > >
> > > > > So I want to put these class and xmls together under the webapp
> > module.
> > > > At
> > > > > last, they should be put under the
> > webpp/target/myweb/WEB-INFO/classes.
> > > > >
> > > > > 2010/6/10 Justin Edelson <ju...@gmail.com>
> > > > >
> > > > > > If you don't want them in the server jar, why are they in the
> > server
> > > > > module
> > > > > > source tree?
> > > > > >
> > > > > > If you can't move the files, see
> > > > > >
> > > > >
> > > >
> > >
> >
> http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html
> > > > > >
> > > > > > HTH,
> > > > > > Justin
> > > > > >
> > > > > > On Jun 10, 2010, at 12:29 AM, maven apache <
> apachemaven0@gmail.com
> > >
> > > > > wrote:
> > > > > >
> > > > > > > HI:
> > > > > > > I have two maven module:server(jar) and webapp(war).
> > > > > > > And the server module is a dependency of webapp.
> > > > > > > There are some resources under the server
> > > > :/src/main/java/org/kk/*.xml,
> > > > > I
> > > > > > do
> > > > > > > not want these xmls jared to the server.jar. I just want it put
> > > under
> > > > > the
> > > > > > > webapp/target/app/WEB-INFO/classes.
> > > > > > >
> > > > > > > How to config it?
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > > For additional commands, e-mail: users-help@maven.apache.org
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: maven resources
Posted by maven apache <ap...@gmail.com>.
2010/6/10 Anders Hammar <an...@hammar.net>
> Ok, I think you don't understand what I'm saying. Of course the files are
> required in runtime, but should the user expect it to already be shipped
> with the jar och provide it himself/herself?
> Putting the xml files under test/resource will make them available in
> runtime when testing your server module. This is what you would od if the
> xml files are not to be shipped with the jar, but you still need a way to
> test it.
>
Thanks, I will try it.
> /Anders
> On Thu, Jun 10, 2010 at 08:42, maven apache <ap...@gmail.com>
> wrote:
>
> > 2010/6/10 Anders Hammar <an...@hammar.net>
> >
> > > First of all, xml files should go under resources/ not java/.
> Regardless
> > if
> > > you have it in the server jar or the webapp war.
> > >
> > > Then, this is how you should think: Think Java! How is the server jar
> > > supposed to be used. Is the user supposed to add the xml files
> themselves
> > >
> > Yes, but these xml filse are not just for tested, then are required in
> the
> > runtime.
> > Also user can add a class(with a xml file together) in the
> WEB-INFO/classes
> > to extend the fuction of my web application.
> > So I do not want them packaged in the server.jar.
> >
> > > (then the xml fiels should not be packaged in the server jar) or are
> the
> > > xml
> > > files part of the server implementation (then they go in the server
> jar)?
> > > If the xml files shouldn't be packaged in the server jar, you most
> likely
> > > you still need a set of them during development/testing. Then you put
> > that
> > > set of xml files in src/test/resources/. They will be used during unit
> > > testing but not packaged in the server jar.
> > >
> > They are not just for test.
> >
> > Now, I have no choice but put the xmls to the server.jar.
> >
> > >
> > > /Anders
> > > On Thu, Jun 10, 2010 at 07:23, maven apache <ap...@gmail.com>
> > > wrote:
> > >
> > > > What is going on is that under my package each class need a xml file.
> > > > If I put these xmls to the webapp/src/resources folder,it is not
> > > convenient
> > > > for development in my IDE.
> > > >
> > > > So I want to put these class and xmls together under the webapp
> module.
> > > At
> > > > last, they should be put under the
> webpp/target/myweb/WEB-INFO/classes.
> > > >
> > > > 2010/6/10 Justin Edelson <ju...@gmail.com>
> > > >
> > > > > If you don't want them in the server jar, why are they in the
> server
> > > > module
> > > > > source tree?
> > > > >
> > > > > If you can't move the files, see
> > > > >
> > > >
> > >
> >
> http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html
> > > > >
> > > > > HTH,
> > > > > Justin
> > > > >
> > > > > On Jun 10, 2010, at 12:29 AM, maven apache <apachemaven0@gmail.com
> >
> > > > wrote:
> > > > >
> > > > > > HI:
> > > > > > I have two maven module:server(jar) and webapp(war).
> > > > > > And the server module is a dependency of webapp.
> > > > > > There are some resources under the server
> > > :/src/main/java/org/kk/*.xml,
> > > > I
> > > > > do
> > > > > > not want these xmls jared to the server.jar. I just want it put
> > under
> > > > the
> > > > > > webapp/target/app/WEB-INFO/classes.
> > > > > >
> > > > > > How to config it?
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > For additional commands, e-mail: users-help@maven.apache.org
> > > > >
> > > > >
> > > >
> > >
> >
>
Re: maven resources
Posted by Anders Hammar <an...@hammar.net>.
Ok, I think you don't understand what I'm saying. Of course the files are
required in runtime, but should the user expect it to already be shipped
with the jar och provide it himself/herself?
Putting the xml files under test/resource will make them available in
runtime when testing your server module. This is what you would od if the
xml files are not to be shipped with the jar, but you still need a way to
test it.
/Anders
On Thu, Jun 10, 2010 at 08:42, maven apache <ap...@gmail.com> wrote:
> 2010/6/10 Anders Hammar <an...@hammar.net>
>
> > First of all, xml files should go under resources/ not java/. Regardless
> if
> > you have it in the server jar or the webapp war.
> >
> > Then, this is how you should think: Think Java! How is the server jar
> > supposed to be used. Is the user supposed to add the xml files themselves
> >
> Yes, but these xml filse are not just for tested, then are required in the
> runtime.
> Also user can add a class(with a xml file together) in the WEB-INFO/classes
> to extend the fuction of my web application.
> So I do not want them packaged in the server.jar.
>
> > (then the xml fiels should not be packaged in the server jar) or are the
> > xml
> > files part of the server implementation (then they go in the server jar)?
> > If the xml files shouldn't be packaged in the server jar, you most likely
> > you still need a set of them during development/testing. Then you put
> that
> > set of xml files in src/test/resources/. They will be used during unit
> > testing but not packaged in the server jar.
> >
> They are not just for test.
>
> Now, I have no choice but put the xmls to the server.jar.
>
> >
> > /Anders
> > On Thu, Jun 10, 2010 at 07:23, maven apache <ap...@gmail.com>
> > wrote:
> >
> > > What is going on is that under my package each class need a xml file.
> > > If I put these xmls to the webapp/src/resources folder,it is not
> > convenient
> > > for development in my IDE.
> > >
> > > So I want to put these class and xmls together under the webapp module.
> > At
> > > last, they should be put under the webpp/target/myweb/WEB-INFO/classes.
> > >
> > > 2010/6/10 Justin Edelson <ju...@gmail.com>
> > >
> > > > If you don't want them in the server jar, why are they in the server
> > > module
> > > > source tree?
> > > >
> > > > If you can't move the files, see
> > > >
> > >
> >
> http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html
> > > >
> > > > HTH,
> > > > Justin
> > > >
> > > > On Jun 10, 2010, at 12:29 AM, maven apache <ap...@gmail.com>
> > > wrote:
> > > >
> > > > > HI:
> > > > > I have two maven module:server(jar) and webapp(war).
> > > > > And the server module is a dependency of webapp.
> > > > > There are some resources under the server
> > :/src/main/java/org/kk/*.xml,
> > > I
> > > > do
> > > > > not want these xmls jared to the server.jar. I just want it put
> under
> > > the
> > > > > webapp/target/app/WEB-INFO/classes.
> > > > >
> > > > > How to config it?
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> >
>
Re: maven resources
Posted by maven apache <ap...@gmail.com>.
2010/6/10 Anders Hammar <an...@hammar.net>
> First of all, xml files should go under resources/ not java/. Regardless if
> you have it in the server jar or the webapp war.
>
> Then, this is how you should think: Think Java! How is the server jar
> supposed to be used. Is the user supposed to add the xml files themselves
>
Yes, but these xml filse are not just for tested, then are required in the
runtime.
Also user can add a class(with a xml file together) in the WEB-INFO/classes
to extend the fuction of my web application.
So I do not want them packaged in the server.jar.
> (then the xml fiels should not be packaged in the server jar) or are the
> xml
> files part of the server implementation (then they go in the server jar)?
> If the xml files shouldn't be packaged in the server jar, you most likely
> you still need a set of them during development/testing. Then you put that
> set of xml files in src/test/resources/. They will be used during unit
> testing but not packaged in the server jar.
>
They are not just for test.
Now, I have no choice but put the xmls to the server.jar.
>
> /Anders
> On Thu, Jun 10, 2010 at 07:23, maven apache <ap...@gmail.com>
> wrote:
>
> > What is going on is that under my package each class need a xml file.
> > If I put these xmls to the webapp/src/resources folder,it is not
> convenient
> > for development in my IDE.
> >
> > So I want to put these class and xmls together under the webapp module.
> At
> > last, they should be put under the webpp/target/myweb/WEB-INFO/classes.
> >
> > 2010/6/10 Justin Edelson <ju...@gmail.com>
> >
> > > If you don't want them in the server jar, why are they in the server
> > module
> > > source tree?
> > >
> > > If you can't move the files, see
> > >
> >
> http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html
> > >
> > > HTH,
> > > Justin
> > >
> > > On Jun 10, 2010, at 12:29 AM, maven apache <ap...@gmail.com>
> > wrote:
> > >
> > > > HI:
> > > > I have two maven module:server(jar) and webapp(war).
> > > > And the server module is a dependency of webapp.
> > > > There are some resources under the server
> :/src/main/java/org/kk/*.xml,
> > I
> > > do
> > > > not want these xmls jared to the server.jar. I just want it put under
> > the
> > > > webapp/target/app/WEB-INFO/classes.
> > > >
> > > > How to config it?
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>
Re: maven resources
Posted by Anders Hammar <an...@hammar.net>.
First of all, xml files should go under resources/ not java/. Regardless if
you have it in the server jar or the webapp war.
Then, this is how you should think: Think Java! How is the server jar
supposed to be used. Is the user supposed to add the xml files themselves
(then the xml fiels should not be packaged in the server jar) or are the xml
files part of the server implementation (then they go in the server jar)?
If the xml files shouldn't be packaged in the server jar, you most likely
you still need a set of them during development/testing. Then you put that
set of xml files in src/test/resources/. They will be used during unit
testing but not packaged in the server jar.
/Anders
On Thu, Jun 10, 2010 at 07:23, maven apache <ap...@gmail.com> wrote:
> What is going on is that under my package each class need a xml file.
> If I put these xmls to the webapp/src/resources folder,it is not convenient
> for development in my IDE.
>
> So I want to put these class and xmls together under the webapp module. At
> last, they should be put under the webpp/target/myweb/WEB-INFO/classes.
>
> 2010/6/10 Justin Edelson <ju...@gmail.com>
>
> > If you don't want them in the server jar, why are they in the server
> module
> > source tree?
> >
> > If you can't move the files, see
> >
> http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html
> >
> > HTH,
> > Justin
> >
> > On Jun 10, 2010, at 12:29 AM, maven apache <ap...@gmail.com>
> wrote:
> >
> > > HI:
> > > I have two maven module:server(jar) and webapp(war).
> > > And the server module is a dependency of webapp.
> > > There are some resources under the server :/src/main/java/org/kk/*.xml,
> I
> > do
> > > not want these xmls jared to the server.jar. I just want it put under
> the
> > > webapp/target/app/WEB-INFO/classes.
> > >
> > > How to config it?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
Re: maven resources
Posted by maven apache <ap...@gmail.com>.
What is going on is that under my package each class need a xml file.
If I put these xmls to the webapp/src/resources folder,it is not convenient
for development in my IDE.
So I want to put these class and xmls together under the webapp module. At
last, they should be put under the webpp/target/myweb/WEB-INFO/classes.
2010/6/10 Justin Edelson <ju...@gmail.com>
> If you don't want them in the server jar, why are they in the server module
> source tree?
>
> If you can't move the files, see
> http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html
>
> HTH,
> Justin
>
> On Jun 10, 2010, at 12:29 AM, maven apache <ap...@gmail.com> wrote:
>
> > HI:
> > I have two maven module:server(jar) and webapp(war).
> > And the server module is a dependency of webapp.
> > There are some resources under the server :/src/main/java/org/kk/*.xml, I
> do
> > not want these xmls jared to the server.jar. I just want it put under the
> > webapp/target/app/WEB-INFO/classes.
> >
> > How to config it?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: maven resources
Posted by Justin Edelson <ju...@gmail.com>.
If you don't want them in the server jar, why are they in the server module source tree?
If you can't move the files, see http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html
HTH,
Justin
On Jun 10, 2010, at 12:29 AM, maven apache <ap...@gmail.com> wrote:
> HI:
> I have two maven module:server(jar) and webapp(war).
> And the server module is a dependency of webapp.
> There are some resources under the server :/src/main/java/org/kk/*.xml, I do
> not want these xmls jared to the server.jar. I just want it put under the
> webapp/target/app/WEB-INFO/classes.
>
> How to config it?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org