|
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
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.
|
|
Message #268332
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Re: Build Java Projects with Raven
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
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 #268349
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
new build system?
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 ...andjackrabbit: 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
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 #268379
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Re: new build system?
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?
+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 #268712
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Expressiveness for filesystem tasks
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?
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 |
 |
 |
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 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)
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)
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 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)
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)
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)
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)
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, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now.
(June 15, Tech Talk)
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)
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)
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)
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)
Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers.
(May 21, Tech Talk)
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)
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)
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)
|
|