[jsword-devel] maven vs ant
trent.jsword at trentonadams.ca
trent.jsword at trentonadams.ca
Sun Feb 21 01:42:27 MST 2010
Hi Guys,
Okay, so I have a working bible desktop using maven; though I'm not done yet. Yep, converting to maven is definitely not something that someone who's never used maven before would want to do. It took a bit longer than expected (2-4 hours), and I'm still not done. ;) Although, who knows, someone who knows the jsword project better might have been faster?!?! :P
I still need to do at least the following...
- jar signing # never done it before
- run bibledesktop using a profile
- work something out for the jlfgr jar. Perhaps those should just be in the bibledesktop resources? Or should they be in their own module? We could just create a sub module, with no source files, and only "src/main/resources", and package them in a jar automatically?
- write an email with a bunch of maven gotchas, so you guys don't bang your heads against walls in the maven learning curve.
- finish fixing unit test issues
- the jsword project lead needs to prepare an account on a public maven repository, so we can push these things through maven. Assuming of course that is what you guys want to do. Or, if you really want, we can setup a maven.crosswire.org repository, and just put that in the base pom.
I highly recommend the core developers move ALL resources to "src/main/resources" of each sub module. After that, the "resources" sections in the poms can be removed, as the default behaviour is to copy all files from the "src/main/resources" folder into the classpath before building the JARs. I *hacked* the resource filters I currently have in the POM files, because I didn't want to mess around figuring out what resources were in what module, etc; so I just made them all the same, lol.
I realized why some of the tests are failing. It's because I need to setup the "testResources" in the poms, or we need to move the test resources to "src/test/resources" of each submodule as I mentioned above for the main resources.
The following commands, from the command line, should work. At some point, I'll try it in eclipse for you guys, and see if there's any maven related problems. I don't use eclipse, so I don't know yet.
The following commands will only work in a unix environment, including mac os X terminal. I literally copied and pasted the following commands in their entirety, into my terminal, and they "just worked". If you have problems, let me know.
# put poms.tar.gz in trunk/
tar -xvzf poms.tar.gz # extracts all poms to appropriate folders.
mvn install
cd bibledesktop
mvn dependency:copy-dependencies # copies all dependencies to "target/dependency"
export CLASSPATH=target/bibledesktop-1.6.1-SNAPSHOT.jar:$(for jar in target/dependency/*.jar; do echo -n $jar:; done)
java org.crosswire.bibledesktop.desktop.Desktop
YAY it's working, hehe.
----- "trent jsword" <trent.jsword at trentonadams.ca> wrote:
> From: "trent jsword" <trent.jsword at trentonadams.ca>
> To: "J-Sword Developers Mailing List" <jsword-devel at crosswire.org>
> Sent: Saturday, February 20, 2010 9:55:18 PM GMT -06:00 US/Canada Central
> Subject: Re: [jsword-devel] maven vs ant
>
> ----- "DM Smith" <dmsmith at crosswire.org> wrote:
>
> > From: "DM Smith" <dmsmith at crosswire.org>
> > To: "J-Sword Developers Mailing List" <jsword-devel at crosswire.org>
> > Sent: Saturday, February 20, 2010 5:45:19 PM GMT -06:00 US/Canada
> Central
> > Subject: Re: [jsword-devel] maven vs ant
> >
> > Joe and I restructured JSword's projects to be inline with Maven's
> > expectations. So that we could get there some day.
> >
>
> Very nice! ;) Worked great on commons folder. Only the LZSSTest is
> failing, and it's cause there's an issue with the kjv_genesis.txt
> resource. I'll work that out once I get the other modules working.
> But, on the upside, 38 of 39 tests passed fine.
>
> Your mac should have maven 2.0.10 on it already, so it should just
> work.
>
> Below is the pom.xml, just stick it in trunk/common/pom.xml
>
> Run the following
> mvn -P test package
>
> The test profile above enables testing, which I have disabled by
> default; you can see that in the POM.
>
> Right now, it's a standalone pom. Later, I'll have a base pom in
> trunk/, and all other poms will inherit from that. But, I wanted to
> get common working first. :D
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>org.crosswire</groupId>
> <artifactId>jsword-common</artifactId>
> <packaging>jar</packaging>
> <version>1.6.1-SNAPSHOT</version>
> <name>jsword-common</name>
> <url>http://maven.apache.org</url>
> <dependencies>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>3.8.1</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>log4j</groupId>
> <artifactId>log4j</artifactId>
> <version>1.2.12</version>
> <scope>compile</scope>
> </dependency>
>
> <dependency>
> <groupId>commons-codec</groupId>
> <artifactId>commons-codec</artifactId>
> <version>1.3</version>
> </dependency>
> <dependency>
> <groupId>commons-httpclient</groupId>
> <artifactId>commons-httpclient</artifactId>
> <version>3.1</version>
> </dependency>
> <dependency>
> <groupId>commons-logging</groupId>
> <artifactId>commons-logging</artifactId>
> <version>1.1.1</version>
> </dependency>
> <dependency>
> <groupId>commons-net</groupId>
> <artifactId>commons-net</artifactId>
> <version>1.4.1</version>
> </dependency>
> <dependency>
> <groupId>javatar</groupId>
> <artifactId>javatar</artifactId>
> <version>2.5</version>
> </dependency>
> <dependency>
> <groupId>jdom</groupId>
> <artifactId>jdom</artifactId>
> <version>1.0</version>
> </dependency>
>
> </dependencies>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> </configuration>
> </plugin>
> </plugins>
> </build>
>
> <properties>
> <maven.test.skip>true</maven.test.skip>
> </properties>
>
> <profiles>
> <profile>
> <id>test</id>
> <properties>
> <maven.test.skip>false</maven.test.skip>
> </properties>
> </profile>
> </profiles>
> </project>
>
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poms.tar.gz
Type: application/x-gzip
Size: 1383 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20100221/ffac390d/attachment.gz>
More information about the jsword-devel
mailing list