You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Léa Massiot <lm...@orange.fr> on 2011/10/31 16:17:01 UTC

Compile, build and prepare Webapp for Tomcat in command line

Hello,

Thank you for reading my post.

I am presently programming my Webapps inside "Eclipse".
I would like to automate the compiling and building of my source code.
I need to know which "javac", "java" (and maybe "jar") commands I should run
from a console to generate everything that is needed for my Webapp to be
deployed properly by "Tomcat".
I want to write a batch file ("Windows") and a shell file ("Unix") to do
this work.

Can you give me some advice, indicate me where to look for?
For instance, can I retrieve from "Eclipse" which commands are being
launched when the project is being built? Where?

All the best,
--
Léa
-- 
View this message in context: http://old.nabble.com/Compile%2C-build-and-prepare-Webapp-for-Tomcat-in-command-line-tp32752945p32752945.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Compile, build and prepare Webapp for Tomcat in command line

Posted by Jürgen Link <ju...@googlemail.com>.
Hi Léa,
although it's pretty straight-forward to compile and package all the stuff
you need inside your web application, I'd rather recommend looking into
maven.
It's an excellent project management tool (at least from my point of view)
which supports exactly what you asked for.
By default, it will compile your sources, run the tests (e.g. JUnit),
gather external libraries you need and package everything nicely.
Moreover, Maven itself is a Java application and therefore, platform
independent.

For an overview, you could consult several references, including this one:
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

Cheers
Jürgen

2011/10/31 Léa Massiot <lm...@orange.fr>

>
> Hello,
>
> Thank you for reading my post.
>
> I am presently programming my Webapps inside "Eclipse".
> I would like to automate the compiling and building of my source code.
> I need to know which "javac", "java" (and maybe "jar") commands I should
> run
> from a console to generate everything that is needed for my Webapp to be
> deployed properly by "Tomcat".
> I want to write a batch file ("Windows") and a shell file ("Unix") to do
> this work.
>
> Can you give me some advice, indicate me where to look for?
> For instance, can I retrieve from "Eclipse" which commands are being
> launched when the project is being built? Where?
>
> All the best,
> --
> Léa
> --
> View this message in context:
> http://old.nabble.com/Compile%2C-build-and-prepare-Webapp-for-Tomcat-in-command-line-tp32752945p32752945.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Compile, build and prepare Webapp for Tomcat in command line

Posted by Pid * <pi...@pidster.com>.
On 1 Nov 2011, at 11:34, "Léa Massiot" <lm...@orange.fr> wrote:

>
> @Christopher :
> Thank you for your answer.
> I wouldn't mind using "Maven" instead of "Ant"... yet it doesn't look like I
> can a find a nice and simple (hello world) example to get started with it
> (like the one I found for "Ant", cf. the link in my previous post)...
> Actually, I managed to build my Webapp for Tomcat using "Ant" yesterday...
>
> @Terence :
> Thank you for pointing me to this "build.xml" example file.

www.gradle.org - best of Ant and Maven, less of the trauma.


p



>
> Best regards,
> --
> Léa
> --
> View this message in context: http://old.nabble.com/Compile%2C-build-and-prepare-Webapp-for-Tomcat-in-command-line-tp32752945p32758026.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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


Re: Compile, build and prepare Webapp for Tomcat in command line

Posted by Léa Massiot <lm...@orange.fr>.
@Christopher :
Thank you for your answer. 
I wouldn't mind using "Maven" instead of "Ant"... yet it doesn't look like I
can a find a nice and simple (hello world) example to get started with it
(like the one I found for "Ant", cf. the link in my previous post)...
Actually, I managed to build my Webapp for Tomcat using "Ant" yesterday...

@Terence :
Thank you for pointing me to this "build.xml" example file.

Best regards,
--
Léa
-- 
View this message in context: http://old.nabble.com/Compile%2C-build-and-prepare-Webapp-for-Tomcat-in-command-line-tp32752945p32758026.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Compile, build and prepare Webapp for Tomcat in command line

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
  On 1:59 PM, Léa Massiot wrote:
> @Jürgen : Thank you for advising me to use Maven.
> @Tim : Thank you for advising me to use Ant.
>
> I have been following the following tutorial to get introduced to Ant:
> http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html
> I think it's a good one.
> Now, I am going to have to do something similar with my Webapp...
>
> Cheers,
> --
> Léa

Hi, Léa-

An example ant build.xml file is provided in the Tomcat docs.  I'm not 
sure which version you're using but here's the Tomcat 6 documentation 
that includes a link to the build.xml example:

http://tomcat.apache.org/tomcat-6.0-doc/appdev/source.html#BUILD.XML_Configuration_File

-Terence Bandoian



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


Re: Compile, build and prepare Webapp for Tomcat in command line

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Léa,

On 10/31/2011 12:55 PM, Léa Massiot wrote:
> @Jürgen : Thank you for advising me to use Maven. @Tim : Thank you
> for advising me to use Ant.
> 
> I have been following the following tutorial to get introduced to
> Ant: http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html I
> think it's a good one. Now, I am going to have to do something
> similar with my Webapp...

I've been using ant for quite a while with great success and can
highly recommend it.

That being said, more and more projects are using Maven these days so
if you are starting from scratch, I think I'd look into Maven as well
and make a decision.

Certainly if your project will have many dependencies on 3rd-party
libraries (like Apache libraries, for instance) and your own code will
have it's own dependencies on other projects of yours, consider using
Maven because it has everything you need to do dependency resolution,
etc. with very little effort on your part.

You can think of Maven as a whole bunch of ant scripts already written
for you. (IIRC, Maven 1.x was mostly just that: tons and tons of ant
scripts to do everything). The new Maven is much more robust, can do
many more things, and isn't constrained to ant's more make-like behavior.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6vCoEACgkQ9CaO5/Lv0PDj5ACeOons4hPFPty4u/oXs1ps8/pr
S18An0eTL6CSTUhKyVvO5XKzGMiOk9Im
=qhI4
-----END PGP SIGNATURE-----

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


Re: Compile, build and prepare Webapp for Tomcat in command line

Posted by Léa Massiot <lm...@orange.fr>.
@Jürgen : Thank you for advising me to use Maven.
@Tim : Thank you for advising me to use Ant.

I have been following the following tutorial to get introduced to Ant:
http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html
I think it's a good one.
Now, I am going to have to do something similar with my Webapp...

Cheers,
--
Léa
-- 
View this message in context: http://old.nabble.com/Compile%2C-build-and-prepare-Webapp-for-Tomcat-in-command-line-tp32752945p32753619.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Compile, build and prepare Webapp for Tomcat in command line

Posted by Tim Watts <ti...@cliftonfarm.org>.
On Mon, 2011-10-31 at 08:17 -0700, Léa Massiot wrote:
> Hello,
> 
> Thank you for reading my post.
> 
> I am presently programming my Webapps inside "Eclipse".
> I would like to automate the compiling and building of my source code.
> I need to know which "javac", "java" (and maybe "jar") commands I should run
> from a console to generate everything that is needed for my Webapp to be
> deployed properly by "Tomcat".
> I want to write a batch file ("Windows") and a shell file ("Unix") to do
> this work.
> 
Is there a particular reason you don't want to use Ant?  You could build
and test the Ant script in Eclipse -- using it's editor with Ant support
-- then use the same Ant script to run on windows or unix.  At a command
shell you would just change to the project dir and type 'ant'. 

	http://ant.apache.org/

> Can you give me some advice, indicate me where to look for?
> For instance, can I retrieve from "Eclipse" which commands are being
> launched when the project is being built? Where?
> 
> All the best,
> --
> Léa



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