[Jwebunit-development] Building jwebunit with maven
Brought to you by:
henryju
|
From: Martijn D. <ma...@da...> - 2004-06-07 21:08:22
|
Here's a short manual for using maven to build jwebunit, or to generate
the infamous website. I also created the doc in the xdocs, so if you
generate the website (see below) then you'll also have this manual.
Installing and configuring maven
First you need to download the latest maven, which currently is
maven-1.0-rc3 (release candidate 3), make sure you download the archive,
not the exe installer.
Installing maven should be easy: unzip the file to any directory you
like, let's say: c:\maven-1.0-rc3
Next you need to do 3 things:
* add an environment variable MAVEN_HOME which points to the install
directory of maven, i.e. c:\maven-1.0-rc3
* add MAVEN_HOME\bin to your path (use the variable, this way, you can
switch more easily when a new version arrives)
* add to your home directory (under windows 2000 and XP: C:\Documents
and Settings\<username>) a file called build.properties, and put the
following entries in it:
maven.home.local=${maven.home}/cache
maven.repo.local=c:/maven-repository
maven.repo.remote=http://www.ibiblio.org/maven
You can replace the maven.repo.local entry with a directory of your
liking. I advise you to make the directory seperate from the maven home
directory. Maven downloads all dependencies into this directory. This
repository can be shared among maven versions, and even developers on
the same machine. The cache directory (the first entry) can't be shared
between maven versions, so this should stay within the maven home directory.
Using maven
Usage of maven is very simple: just run in the jwebunit directory, where
the project.xml file resides, the command:
maven
You will see maven downloading all kinds of stuff, and compiling,
testing and building a jar file:
<!-- start log -->
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0-rc3
Plugin cache will be regenerated
Directory c:\maven-repository bestaat niet. Probeer hem aan te maken.
Probeer junit-3.8.1.jar te downloaden.
........
.
Probeer nekohtml-0.8.1.jar te downloaden.
....
.
Probeer js-1.5R4.1.jar te downloaden.
.......................
.
Probeer xml-apis-1.0.b2.jar te downloaden.
.....
.
Probeer xercesImpl-2.6.2.jar te downloaden.
....................................
.
Probeer servletapi-2.3.jar te downloaden.
...
.
Probeer httpunit-1.5.4.jar te downloaden.
...............
.
Probeer dom4j-1.4-dev-8.jar te downloaden.
.....................
.
Probeer commons-jelly-20030902.160215.jar te downloaden.
......
.
Probeer commons-jelly-tags-jsl-20030211.143151.jar te downloaden.
..
.
Probeer commons-jelly-tags-log-20030211.142821.jar te downloaden.
..
.
Probeer commons-jelly-tags-velocity-20030303.205659.jar te downloaden.
..
.
Probeer commons-jelly-tags-xml-20030211.142705.jar te downloaden.
..
.
Probeer commons-logging-1.0.3.jar te downloaden.
..
.
Probeer maven-1.0-rc2.jar te downloaden.
........
.
Probeer velocity-1.4-dev.jar te downloaden.
..............
.
Probeer velocity-dvsl-0.45.jar te downloaden.
..
.
Probeer maven.jar te downloaden.
.....
.
Probeer isorelax-20030108.jar te downloaden.
........
.
Probeer jing-20030619.jar te downloaden.
....................
.
Probeer xerces-2.4.0.jar te downloaden.
..............................
.
Probeer commons-io-20030203.000550.jar te downloaden.
...
.
Probeer commons-net-1.0.0.jar te downloaden.
.....
.
Probeer commons-httpclient-2.0-beta1.jar te downloaden.
........
.
Probeer commons-lang-1.0.1.jar te downloaden.
....
.
Probeer jsch-0.1.5.jar te downloaden.
...
.
Probeer commons-jelly-tags-antlr-20030211.143720.jar te downloaden.
..
.
Probeer antlr-2.7.2.jar te downloaden.
..............
.
build:start:
java:prepare-filesystem:
java:compile:
[echo] Compiling to C:\workspace\jWebUnit/target/classes
java:jar-resources:
test:prepare-filesystem:
test:test-resources:
test:compile:
test:test:
[junit] Running net.sourceforge.jwebunit.ExpectedTableAssertionsTest
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0,594 sec
[junit] Running net.sourceforge.jwebunit.ExpectedTableTest
[junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0,343 sec
[junit] Running net.sourceforge.jwebunit.FormAssertionsTest
[junit] Tests run: 23, Failures: 0, Errors: 0, Time elapsed: 2,469 sec
[junit] Running net.sourceforge.jwebunit.FormSubmissionTest
[junit] Tests run: 18, Failures: 0, Errors: 0, Time elapsed: 2,969 sec
[junit] Running net.sourceforge.jwebunit.FramesAndWindowsTest
[junit] Tests run: 8, Failures: 0, Errors: 0, Time elapsed: 1,328 sec
[junit] Running net.sourceforge.jwebunit.JavaScriptEventsTest
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0,907 sec
[junit] Running net.sourceforge.jwebunit.NavigationTest
[junit] Tests run: 10, Failures: 0, Errors: 0, Time elapsed: 2,282 sec
[junit] Running net.sourceforge.jwebunit.ServletUnitTest
[junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0,687 sec
[junit] Running net.sourceforge.jwebunit.TableAssertionsTest
[junit] Tests run: 13, Failures: 0, Errors: 0, Time elapsed: 1,531 sec
[junit] Running net.sourceforge.jwebunit.TestContextTest
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0,36 sec
[junit] Running net.sourceforge.jwebunit.TextAndElementWalkerTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0,328 sec
[junit] Running net.sourceforge.jwebunit.util.reflect.MethodInvokerTest
[junit] Tests run: 7, Failures: 0, Errors: 0, Time elapsed: 0,328 sec
[junit] Running net.sourceforge.jwebunit.WebAssertionsTest
[junit] Tests run: 15, Failures: 0, Errors: 0, Time elapsed: 1,828 sec
[junit] Running net.sourceforge.jwebunit.WebCookieTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0,422 sec
jar:jar:
[echo] Warning: shortDescription is greater than 49 characters -
trimming for specification title.
[jar] Building jar: C:\workspace\jWebUnit\target\jwebunit-1.2.jar
BUILD SUCCESSFUL
Total time: 1 minutes 53 seconds
Finished at: Mon Jun 07 23:06:15 CEST 2004
<!-- end log -->
You have succesfully built the jwebunit jar file.
Generating the website using maven
This one is also quite simple:
maven site
After downloading lots and lots of jar files, maven will build the
website which contains junit results, checkstyle results, and the like.
You can find the website in the target/docs directory: just open the
index.html in your browser.
Doing a release build with maven
TODO
|