Posted 971 days ago
I mentioned in my post on Getting Started with Shale that I'd come back to using it with Maven. Since the project is so new, there's no Shale artifact in the Ibiblio repository. For the time being, you should install Shale into your local repository by hand. This will let you use Shale as a dependency in your applications managed by Maven the way you'd expect too.
The first step is to download the latest nightly build of Shale. You can find the nighly builds in their CVS repository.
Extract the bundle and go into the dist directory. You'll see 6 jar files that we'll install into your repository. In general, for each jar, executing:
mvn install:install-file
-DgroupId=<struts-shale>
-DartifactId=<jarname>
-Dversion=<SNAPSHOT>
-Dfile=<path-to-file>
-Dpackaging=<jar>
-DgeneratePom=true
Will be sufficient, however, shale-core has several dependencies. It would be nice if listing shale-core as a dependency of your project automatically got you it's dependencies as well. To accomplish this, we'll create a simple POM for the shale-core artifact:
shale-core-SNAPSHOT.pom
<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>struts-shale</groupId>
<artifactId>shale-core</artifactId>
<packaging>jar</packaging>
<version>SNAPSHOT</version>
<name>Struts Shale</name>
<url>http://struts.apache.org</url>
<dependencies>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>commons-chain</groupId>
<artifactId>commons-chain</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</project>
Then install the jar with it's POM by executing:
mvn install:install-file
-DgroupId=<struts-shale>
-DartifactId=<jarname>
-Dversion=<SNAPSHOT>
-Dfile=<path-to-file>
-Dpackaging=<jar>
-DgeneratePom=true
-DpomFile=<path-to-pom>
NOTE: If you're using a Maven version before 2.0.1 SNAPSHOT, you'll need to copy the POM into your repository manually:
cp shale-core-SNAPSHOT.pom ~/m2/repository/struts-shale/shale-core/SNAPSHOT/
You can repeat this process every now and then with the latest nightly snapshot to keep current on Shale builds until the Ibiblio repository gets an artifact for it.
Posted 973 days ago
It's been a while since I've started a new J2EE project from scratch, and a lot has changed since the last time I did. I've been working in the J2EE arena for quite a few years now, but with the exception of jETIA, which I started in 2002, I've only been involved in existing projects. jETIA's build system was Ant, revision control was Subversion, and project management and dependencies were managed by hand.
I learned about Maven about a year ago when I responsibilities at my previous job suddenly included maintenance and development of a large, complicated ant based build system. I had hoped that Maven would be the golden solution to my dependency maintenance nightmares, and complicated Ant scripts integrating our source control mechanisms - however I quickly learned (the hard way) that Maven was not flexible enough to adapt to your project structure; I'd have to make my project structure meet their idea of a good layout. Not that I objected to their layout, but the discombobulated state of the project I was working on took years to screw up so badly; fixing it would only further confuse the developers who held deep understanding of how the project ran.
Which brings us today, with my new Maven book (Maven : A Developer's Notebook) and the need to start a project from scratch. Sadly, the book I bought not 4 weeks ago is officially out of date, as Maven 2 is now the standard release, and my book only briefly mentions that while the concepts are the same in version 2, that it's a complete rewrite of the system. Many commands are the same, but the one thing I wanted to do - create a new project - has changed :-\.
Additionally, I discovered today that my MVC framework of choice, Struts, has drastically changed as well! Struts is now broken into two core projects: Structs Action framework - the "original" struts, so to speak, and Shale, a Java Server Faces based MVC framework being billed as "what Struts would have been if we'd known then what we know now".
How fast things change. I feel like, from a technology standpoint, I'm starting all over again... While initially discouraging for me, this should be exciting for you, because this means that I'll be posting many many how tos on getting started with these exciting new versions of technologies designed to make you life in J2EE easier!
So my question to you, then, is aside from Maven for project management, Struts and/or Shale for a strong MVC framework, and Spring for a solid IoC driven dependency injection mechanism - what should I be reading up on during my "technology review" stages, and what are your opinions on them?
add to
del.icio.us