Ant Anywhere

Description

(Apache) Ant Anywhere (AAA?) bridges the gap between the ever-so-useful, but command-line oriented, Apache Ant, and command-line averse WWW users.

Motivation

I believe that the difficulty in installing most Open Source Software applications is a critical problem. By making it super-easy for developers to make their Java applications installable with just a click, I hope to enable them to get a broader user base and to show the way to better applications.

This O'Reilly article makes mention of the install problem.

RUNNING.TXT of Apache Tomcat is an anti-pattern. That file isn't conveniently web linkable, but the Tomcat Setup doc might lure one into thinking all is well (but note the "If using a J2SE 1.4 JRE" note). This gives a better idea of what's wrong: Idiot's guide to installing Java and Tomcat. This too: How-to install Tomcat on Mac OS X. Some folks have made a stab at fixing the problem for Tomcat.

Demo

The Ant Anywhere Demo is a simple loader that packages up a directory of resources and then runs Ant on the build.xml in that directory. AntForm is included so that Swing menus can be easily used.

Ant Anywhere is Ant Anywhere itself with an AntForm GUI so you can create Java Web Start files for your own project by just filling in the blanks.

If you get an error from Java Web Start complaining about not being able to load a resource, give it a second try (I've seen a case were it failed to load the logo icon on the first try).

You can see the files on the web server at http://pagesmiths.com/code/ant-anywhere-demo/.

The default index HTML file has been renamed to "xindex.html" so you can see the directory contents as well as that source (otherwise pointing a browser there would just get the redirect to the JNLP launch file). You'll notice META-INF and WEB-INF directories because this is actually an unpacked WAR which can be used to deploy the demo as a self-serving web app by dropping in on your favorite JEE servlet container.

Download

A binary including all source and dependencies at http://sourceforge.net/project/showfiles.php?group_id=168062&package_id=215050.

That is a snapshot of the development directory and currently lacks any information on how to build or use it.

The source at http://appletserver.svn.sourceforge.net/viewvc/appletserver/AntAnywhere/.

To Do

Maven Repository (Maven Everywhere?)

The current prototype just copies the whole resources directory into a separate space for each application. Also if one were to follow the example of using the convenient-but-flawed JNLP-WAR Ant task, each jar in the lib is signed and copied without version information. That is not desireable considering that many applications are built from common components. The solution is to use a common repository so that shared files don't need to be downloaded and stored multiple times.

The right tool for that job appears to be Apache Maven.

http://docs.codehaus.org/pages/viewpage.action?pageId=54019

http://maven.apache.org/maven-1.x/using/repositories.html

Ivy

Ivy is dependency management done the Ant-way. It also supports Maven & Maven2. AntAnywhere is using Ivy.

Ivy+SVN provides Subversion support for Ivy: http://www.ivytools.org/ivy+svn.html.

"CJAN" (Comprehensive Java Archive Network)

Handling project sources, binaries, and dependencies automatically as in "CPAN for Java" is part of what we're after here. And several folks have started projects called "CJAN", but none seem to have been successful.

http://en.wikipedia.org/wiki/CJAN http://wiki.java.net/bin/view/Projects/CJAN http://jakarta.apache.org/commons/sandbox/jjar/

IzPack

IzPack is an OSS installer maker for Java.

Integrating IzPack with AntAnywhere will make a full-featured solution (when we've got services management too of course).

Article on IzPack support in NetBeans
http://maxnitribitt.blog-city.com/izpack_tutorial_1.htm

"Deployment: Easy Installing with IzPack"

OSGi

OSGi, JNLP, and Jar Versioning are coming together as JSR-XXX.

http://www.pierocampanelli.info/articles/2006/11/15/osgi-and-open-source-ecosystem

Spring-OSGi

The Spring folks are also making OSGi easier to use including Maven support. http://www.springframework.org/osgi

Swing Application Framework (JSR-296)

The Swing Application Framework provides application lifecycle API for Swing applications. Noteworthy because it is applet & sandbox compatible.

https://appframework.dev.java.net/

NetBeans Module API

NetBeans RCP (hence Swing) complement to Eclipse's RIA. http://platform.netbeans.org/

Embedded Web Server (Apache Anywhere)

Since many of the applications we'ld like to distribute are web applications, we need a web server to run them on. So we need to package up a web server or two. Jetty is easy to package, but not all web applications work with it[1], so the popular Apache Tomcat is needed too. And to make that useful we need a control panel. Also some glue so that web applications (WARs) packaged as AA JNLP files can deal with the web server dependency and user preferences. Finally a MIME type handler for web applications that are just packaged as plain WARs might be nice too.

Web UI (GWT)

The prototype uses Ant Form to present a Swing UI. While that may be fine for a few things that can only be performed locally on the desktop (like embedded web server configuration that can't be done after the web server starts), in IFCX we always want to make sure there is a Web UI.

GWT is the natural toolkit for this.

For those wondering why we need a Web UI for personal applications and don't think that remote access is a common enough use case, here are a few more reasons:

  1. Given that the user clicked in a web browser to launch the application, unless we know otherwise we should assume they'ld like the application to present itself in the web browser. Forcing a switch of UI modes should only be done when retaining the current mode is not possible.
  2. While Sun's Java Web Start will always have Swing, that doesn't mean all JNLP capable platforms have it.
  3. We should not assume that because a user can access their web browser that they can (or can just as easily) use Swing. Even though Swing has good Accessibility support, that doesn't mean the user is configured for it or is familiar with it.

Zeroconf

User friendly hostnames and automatic service discovery & configuration are definitely things we want. Zeroconf is the way to go (alas Jini, like Java Applets, died due to bad parenting).

While Apple's improved licensing (Wikipedia:Apache License) for Bonjour aka Zeroconf is nice, I want to see how well a Java implementation works.

This article on jRendezvous in MacDevCenter looks helpful. jRendezvous was implemented by Arthur Van Hoff while at Strangeberry, but the old links there are no longer active. Fortunately Arthur had the good sense to use LGPL as the license.

jRendezvous is now jmDNS (Java Multicast DNS) and it is at SF: http://jmdns.sourceforge.net/

UPnP

And since Microsoft will obviously continue to ignore open standards in favor of their versions, bridging the gap between Zeroconf and UPnP is something we'll have to do ourselves. A particular motivation is that some routers (such as the Linksys WRT52G) support UPnP. Also Windows and IE presumably can something with it.

The UPnP Forum is the primary reference site.

Cyberlink for Java is an OSS (BSD) Java implementation of UPnP. The project is on SF.

Resources

Ant

http://www.hughreid.com/articles/ant_build_components.html

http://www.onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.html

http://www.antcommander.com/

http://www.ggtools.net/grand/

http://antinstaller.sourceforge.net/

http://antigen.sourceforge.net/

AntForms & AntMenus is an easy-to-use tool for creating Swing UI for interacting with the user from an Ant Script: http://antforms.sourceforge.net/usageam.html. AntAnywhere currently uses this library.

AntAnt is a precooked Ant build for typical Java projects: http://dehora.net/code/antant/readme.html.

Spring WebFlow has a multiproject Ant build that uses Ivy (which in turn works with Maven & Maven2) called common-build. It is comprehensive with support for demanding Java applications. While the directory layout looks like overkill for very small projects, it has the benefit of not needing to change as project needs change. It doesn't have its own page or documentation but if you download Spring WebFlow source it is in the "common-build" top level directory: . AntAnywhere is transitioning to common-build.

SFUtils is an Ant task for publishing with the SF.net FRS (File Release System): http://sfutils.sourceforge.net/.

http://www.java-source.net/open-source/installer-generators

http://open-centric.com/myjavapack/

Mac OS X Bundles

Ant task JarBundler makes Mac OS X Bundles.

http://www.loomcom.com/jarbundler/index.html

http://informagen.com/JarBundler/

Sparkle makes updating Mac software easier
http://andymatuschak.org/pages/sparkle

Windows EXE

http://java-ecc.blogspot.com/2004/11/java-app-launcher-jsmooth.html

http://jsmooth.sourceforge.net/

JNLP

JNLP API Javadoc

Java Web Start on Linux
http://dmartin.org/weblog/running-java-web-start-apps-on-ubuntu-linux-for-amd-64

Tools:

The Ant Java Web Start Task "ant-jnlp-war" makes creating a JNLP WAR with embedded codebase servlet and Pack200 a simple one-step process: http://ant-jnlp-war.sourceforge.net/. It is currently used in AntAnywhere.

http://www.marinilli.com/projects/juniper/juniper.html

http://jnlp.sourceforge.net/netx/

Rachel (http://rachel.sourceforge.net/index.html) is a nifty tool that serves up resources out of Jar files using URLs. That is convenient for code that thinks its resources are files and don't want to mess around with classloader jazz.

"Generate a NetBeans module for your library or JavaBeans in one Ant task"

Appcasting
Application delivery via RSS http://connectedflow.com/appcasting/

Articles:

Top Ten Java Web Start Applications

Douglas A. Lyon and Francisco Castellanos "The Initium RJS Screensaver: Part 4, Automatic Deployment", in Journal of Object Technology, vol. 5. no. 8, November-December 2006, pp. 31-40 http://www.jot.fm/issues/issue_2006_11/column4

http://blogs.sun.com/roller/page/lmalventosa?entry=jmx_instrumented_jws_apps

http://www.netbeans.org/kb/articles/matisse-jaws.html

http://java.sun.com/developer/community/askxprt/2006/jl0410.html

http://java.sun.com/developer/technicalArticles/Programming/jnlp/

http://java.sun.com/developer/technicalArticles/JavaLP/javawebstart/AutoInstall.html

http://java.sun.com/products/javawebstart/1.2/docs/developersguide.html#autoinstall

http://www.informit.com/articles/article.asp?p=25044&seqNum=9&rl=1

http://www-128.ibm.com/developerworks/java/library/j-webstart/

Deployment: Goodbye scary security dialog box!

Nice job of packaging using Ant and JNLP in Tibet has equally nice documentation.

Books:

http://www.amazon.com/Java-Deployment-WebStart-Mauro-Marinilli/dp/0672321823

Logging

http://www.puzzlecode.com/puzzlecode/logfeeder

Build Transformations

http://www.eclipse.org/m2m/atl/usecases/BridgeBetweenBuildTools/

While AntAnywhere is not limited to Java applications, it is not intended to manage the general *nix package problem. The proliferation of package managers there isn't the answer either, but we will need to leverage them in the meantime (with the help of system virtualization and application bottles) to get the needed ease-of-use on the way to PUP Foundation.

Zero Install System

A Unix-oriented scheme using feeds for web-based launching ("Unix Web Start"). http://0install.net/

Package Managers

RPM, Apt, Fink, CygWin, ...

Java Native Code

http://jnc.mtsystems.ch/
A GCJ wrapper.
nlink
Annotations for linking to DLLs
https://nlink.dev.java.net/

Groovy has ActiveX support.

Articles

"Resources for Automatic Updates of Java Applications"

"Zero Install: An executable critique of native package systems", by Bruce Byfield

http://polishlinux.org/linux/the-future-of-packaging-software-in-linux/

Ant-based build automation

Anthill article
http://programming.linux.com/programming/05/12/22/1641218.shtml?tid=68