672329 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 16 Messages: 16 Messages: 16 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Build Java Projects with Raven

Posted by: Eugene Ciurana on September 12, 2008 DIGG
Say "nevermore" to inexpressiveness and use Ruby to build your Java applications

Ant is arguably the de facto build tool for the Java™ platform; however, other build tools, which support a more expressive paradigm that XML lacks, are entering the scene. Automation expert Paul Duvall describes how Raven, a build platform built on top of Ruby, leverages the power of a full-featured programming language with the simplicity of a build-centric Domain Specific Language.

Paul writes:
I have an existing Java project, and over the past few years I've meticulously maintained an Ant build script for it. I like the plethora of tasks available for Ant; however, I often find that the XML syntax of Ant scripts is somewhat onerous to write. Further, Ant's XML heritage is occasionally limiting when it comes to expressiveness. In fact, when I find myself needing a higher degree of flexibility (say with conditional logic), I'm often forced to write a custom task or embed logic within Ant's script task using Groovy, for instance.

The article discusses a list of common Java tasks, like javac, javadoc, war, and junit. Raven may provide a more expressive alternative than XML-based build systems by leveraging the flexibility and expressiveness of Ruby and custom DSLs.

Threaded replies

·  Build Java Projects with Raven by Eugene Ciurana on Fri Sep 12 05:41:02 EDT 2008
  ·  Re: Build Java Projects with Raven by Joseph Ottinger on Fri Sep 12 06:00:33 EDT 2008
    ·  Re: Build Java Projects with Raven by Miguel Ping on Fri Sep 12 08:38:14 EDT 2008
    ·  Re: Build Java Projects with Raven by Justin Lee on Fri Sep 12 11:05:40 EDT 2008
    ·  Re: Build Java Projects with Raven by Justin Lee on Fri Sep 12 11:07:33 EDT 2008
    ·  Re: Build Java Projects with Raven by Daniel Gredler on Fri Sep 12 13:08:26 EDT 2008
      ·  new build system? by Joseph Ottinger on Fri Sep 12 13:24:37 EDT 2008
        ·  Re: new build system? by Joubin Houshyar on Sat Sep 13 12:08:27 EDT 2008
          ·  Re: new build system? by Vitaliy Semochkin on Mon Sep 15 10:45:06 EDT 2008
            ·  Re: new build system? by Yves Martin on Mon Sep 15 11:44:29 EDT 2008
              ·  Re: new build system? by Vitaliy Semochkin on Tue Sep 16 05:08:47 EDT 2008
                ·  Expressiveness for filesystem tasks by keith bishop on Tue Sep 16 18:28:34 EDT 2008
                ·  Re: new build system? by Yves Martin on Mon Sep 22 03:27:01 EDT 2008
    ·  Raven and Maven by Deepal Jayasinghe on Mon Sep 15 10:58:55 EDT 2008
  ·  Re: Build Java Projects with Raven by Phil Swenson on Fri Sep 12 14:12:05 EDT 2008
    ·  sorry for the lousy code paste by Phil Swenson on Fri Sep 12 14:14:31 EDT 2008
  ·  Re: Build Java Projects with Raven by Maris Orbidans on Sat Sep 13 10:25:39 EDT 2008
  Message #268328 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Build Java Projects with Raven

Posted by: Joseph Ottinger on September 12, 2008 in response to Message #268327
Raven's pretty neat.

The problems as I see them:
  • Ruby's expressiveness is great. But... I keep thinking there's a DSL out there that doesn't involve Ruby syntax... something that could have a syntax in english, or similar. Imagine:
    compile with javac from sourcedir into destdir
    build war
    using resources
    with classes from destdir
    with dependencies from libdir
    It could even be done with Ruby, come to think of it, with some warts.

  • Dependency management. Don't tell anyone this, okay?

    I'm using Maven 2, because everyone else has drunk the kool-aid and it's a pain to do dependency management manually now. Yes, I'm looking at you, jackrabbit maintainers. If only looks could kill... you screwed up EVEN THE MAVEN DEPENDENCIES *argh* *taking medicine*

    Maven sucks... but the dependency management and bundle generation is the right idea. Good ideas, necessary ideas, done in the worst possible way. (Don't take this as a challenge and try to do it even worser, okay? I'm sure you can, and I don't want to have to scratch my eyes out when I see it.)

    Dependency management is what's killed Ant for me, and I don't see evidence that Raven supports dependencies in a Maven-like fashion.

    And yes, Ant fans, I know about Ivy.


  Message #268332 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Build Java Projects with Raven

Posted by: Miguel Ping on September 12, 2008 in response to Message #268328
I have to maintain a messy ant file, and I cannot oblige other devs to download raven/gant/whatever and set up a environment variable. I would like an ant task that enables me to run raven tasks in a self-contained way.

Other thing that would be nice would be a ant2raven converter.

  Message #268338 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Build Java Projects with Raven

Posted by: Justin Lee on September 12, 2008 in response to Message #268328
Raven's pretty neat.

The problems as I see them:
  • Ruby's expressiveness is great. But... I keep thinking there's a DSL out there that doesn't involve Ruby syntax...


There's always gradle if you want groovy but not gant: http://www.gradle.org/

  Message #268339 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Build Java Projects with Raven

Posted by: Justin Lee on September 12, 2008 in response to Message #268328


Dependency management is what's killed Ant for me, and I don't see evidence that Raven supports dependencies in a Maven-like fashion.

And yes, Ant fans, I know about Ivy.


Oh, and there's this: http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-ant-tasks-2.0.9.jar

  Message #268347 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Build Java Projects with Raven

Posted by: Daniel Gredler on September 12, 2008 in response to Message #268328
I'm using Maven 2, because everyone else has drunk the kool-aid and it's a pain to do dependency management manually now. Yes, I'm looking at you, jackrabbit maintainers. If only looks could kill... you screwed up EVEN THE MAVEN DEPENDENCIES *argh* *taking medicine*

So did the log4j people... sigh.

http://yoavs.blogspot.com/2008/05/caution-log4j-1215-brings-in-bunch-of.html

  Message #268349 Post reply Post reply Post reply Go to top Go to top Go to top

new build system?

Posted by: Joseph Ottinger on September 12, 2008 in response to Message #268347
Guys, what would you think about discussing a new build system, one that used something closer to english to build things, and one that sort of did the thing correctly?

Think of dependency management along rpm's lines:
myapp:
requires: logger
servlet
jcr-impl
and...
logn
provides: logger
...and
jackrabbit:
requires: logger
lucene
jcr
provides: jcr
jcr-impl
You can see a sort of OSGi-like provision capability here - imagine using OSGi for the build system, and having the OSGi container pulling in the dependencies and fulfilling them as it can.

Anyone want to talk about requirements and implementation plan? Maven's the right idea, done the wrong way, and with the wrong audience in mind. Let's fix it.

  Message #268353 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Build Java Projects with Raven

Posted by: Phil Swenson on September 12, 2008 in response to Message #268327
Few comments.

1) Raven has been abandoned in favor of builder: http://incubator.apache.org/buildr/

2) buildr has all the dependency management stuff you guys are talking about

3) I personally found buildr overkill (as I do Maven), so I noticed that builder uses the "AntWrap" gem. So I wrote a build file using Ruby's Rake and the AntWrap gem. Makes translating from Ant easy.

Here's a snippet of a ruby rake file that has java targets:

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rubygems'
require 'antwrap'
require 'java'
web_dir = "../web"
common_lib_dir = "../lib"


@ant = Antwrap::AntProject.new(:ant_home=>'/usr/share/ant')
@ant.mkdir(:dir => "classes")
@ant.path(:id => "common.class.path"){
@ant.fileset(:dir => "#{common_lib_dir}"){
@ant.include(:name => "**/*.jar")
}
}

desc "clean the classes directory"
task :clean do
@ant.delete(:dir => "classes")
end

desc "generate war file"
task :war =>[:compile] do
@ant.war(:update => false, :destfile=>"ei.war", :webxml=>"../web/WEB-INF/web.xml"){
@ant.fileset(:dir => web_dir)
}
end

task :default => [:compile]

desc "compile java classes"
task :compile do
puts "compiling java classes to [classes]..."
@ant.javac(:srcdir => "../src", :destdir => "classes", :deprecation=>true, :debug=>true, :fork=>true){
@ant.classpath(:refid => "common.class.path")
@ant.compilerarg(:value =>"-Xlint")
}
end


end

  Message #268354 Post reply Post reply Post reply Go to top Go to top Go to top

sorry for the lousy code paste

Posted by: Phil Swenson on September 12, 2008 in response to Message #268353
try this:
http://pastie.org/271353

  Message #268377 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Build Java Projects with Raven

Posted by: Maris Orbidans on September 13, 2008 in response to Message #268327
Don't forget GANT

  Message #268379 Post reply Post reply Post reply Go to top Go to top Go to top

Re: new build system?

Posted by: Joubin Houshyar on September 13, 2008 in response to Message #268349

Guys, what would you think about discussing a new build system, one that used something closer to english to build things, and one that sort of did the thing correctly?


Hi Joseph,

I think we're stuck on the way to the cusp of component orientation and the build systems pretty much reflect that reality. Given that we haven't figured out component orientation (in practice) build systems conflate all the aspects of building a complex system.

Imagine a hypothetical virtual build system for a modern skyscraper if it had to include cement mix and form pouring factors alongside of high-level system integration aspects -- you'd get something along the lines of ant (and perhaps) maven ...

I would suggest that the community focus on getting component orientation working. Given that, each level of construction (low level object compositions; component packaging; and finally system assembly) each would have their own (probably) simple and (definitely) focused specialized build system.

Note that such an approach would also (intrinsically) address testing at the appropriate level.

If that doesn't happen, then sure, we could use the OSGi approach, or even the JEE approach (what are those DDs but depenedency patches?), to assemble a large system from pre-built and custom pseudo-components. But the inherent complexity will not go away.

RoR, which was the 'practical' answer to JEE complexity, reduced complexity at the logical level by adopting a finite set of canonical patterns. Naturally, we could do the same with the system build issue. But wait, isn't that called Maven? ;)

/R

  Message #268606 Post reply Post reply Post reply Go to top Go to top Go to top

Re: new build system?

Posted by: Vitaliy Semochkin on September 15, 2008 in response to Message #268379
+1

Yes, Maven is a bit harder to learn than ant but it is the best solution on the market.

raven sounds like reinventing the wheel, and IMHO the wheel isn't very round ;-)

  Message #268608 Post reply Post reply Post reply Go to top Go to top Go to top

Raven and Maven

Posted by: Deepal Jayasinghe on September 15, 2008 in response to Message #268328
How do you compare this and maven ?
What is the advantages I would gain using Raven over Maven ?

Deepal
http://blogs.deepal.org

  Message #268617 Post reply Post reply Post reply Go to top Go to top Go to top

Re: new build system?

Posted by: Yves Martin on September 15, 2008 in response to Message #268606
For those that really love Ant and want a real project model with re-usable target, I'm working on a build system designed as a Ant build.xml generator: http://el4ant.sourceforge.net/

I'm currently including Ivy as dependency manager - used also internally for el4ant plugin dependencies.

Any comment and help welcome - please use SF forums: http://sourceforge.net/forum/forum.php?forum_id=492236

  Message #268664 Post reply Post reply Post reply Go to top Go to top Go to top

Re: new build system?

Posted by: Vitaliy Semochkin on September 16, 2008 in response to Message #268617
For those that really love Ant and want a real project model with re-usable target, I'm working on a build system designed as a Ant build.xml generator: http://el4ant.sourceforge.net/

I'm currently including Ivy as dependency manager - used also internally for el4ant plugin dependencies.

Any comment and help welcome - please use SF forums: http://sourceforge.net/forum/forum.php?forum_id=492236


Which way it is better than Maven2?

  Message #268712 Post reply Post reply Post reply Go to top Go to top Go to top

Expressiveness for filesystem tasks

Posted by: keith bishop on September 16, 2008 in response to Message #268664
One thing sometimes found lacking in both Maven and Ant is the limitation of Ant Path expressions for specifying directories and files.

I've built a library called FSPath which uses 'XPath like' expressions to do filesystem tasks such as searching, copying, moving and deleting.

http://sugar.sourceforge.net/fspath/

IMHO, Maven and Ant may lack expressiveness in certain areas, but there's no reason why little languages can't be plugged in to bridge those gaps.

  Message #269547 Post reply Post reply Post reply Go to top Go to top Go to top

Re: new build system?

Posted by: Yves Martin on September 22, 2008 in response to Message #268664
Here are some points:
- as it is only Ant, Java and Ant knowledge is enough to use, understand, extend and debug el4ant (development begins because maven1 is too limited, and maven2 was beta)
- project model is defined with XML namespaces, extensible with plugins
- it supports multi-projects (called modules in el4ant)
- you can define many runtime targets per module (Main Class, J2EE container, JUnit test suite...) thanks to execution unit concept (think about client/server targets as an example)
- you have fine control on what is included in each jar, war, ear

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 2

Reza Rahman continues to explore the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (January 21, Article)

Ted Neward Q&A: What you must know about JavaScript, Scala and more

Ted Neward is an independent consultant specializing in high-scale enterprise systems, and an authority in Java and .NET technologies. He is the author and co-author of several books, including Effective Enterprise Java. At TheServerSide Java Symposium in March, he will be presenting sessions on pragmatic architecture, ECMAScript and Scala. (January 15, Article)

Developers split on open sourcing Java

Now that Oracle is absorbing Sun Microsystems, there mixed views on what should come of the Java Community Process (JCP). While some say Oracle should become the new steward of Java and keep the JCP much as it was, others argue that it may be time to open-source this widespread language. (November 24, Article)

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Free Book PDF Download: Mastering EJB Third Edition

Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map