Dojo Toolkit Maven Repository
Dojo Toolkit Maven Repository
Join the DZone community and get the full member experience.Join For Free
Discover how you can get APIs and microservices to work at true enterprise scale.
Using maven to build your project is a fantastic for managing your dependencies andavoiding having dependencies (and their dependencies) checked into yourown svn. The only fly in the ointment, is projects that don't publishmaven artifacts, and the Ajax dojo toolkit has been one of these. Until now that is !
I have added a maven build to dojo and created maven repositories for snapshots and releases at:
These repositories contain artifacts for:
dojo toolkit release as a zip, tar.gz and tar.bz2
dojotoolkit packaged as a java war file ready to serve. The war includes afilter that sets the Cache-Control header to encourage browser caching.
cometd artifacts for java API and cometd example war
However, if you are a "from first principals" type, then to checkout and build dojo is now as simple as:
svn co http://svn.dojotoolkit.org/src/view/anon/all/trunk dojo
This will build the standard dojo release and package it as a zip, atar.gz and tar.gz2 and make them available in your local repository.The groupId is org.dojotoolkit and the artifactId is dojo. The following incantation of the maven dependency plugin will download and unpack these artifacts into your maven project:
Along with the build of the dojo release artifacts, dojo is also packaged as a war file with groupId org.dojotoolkit and artifactId dojo-war.The war produced by this can be directly deployed and used by other webapplications on the same server (there is no requirement for js to beserved from the same war as your application). Alternately, this warcan be used as an overlay by the maven war plugin and merged with yourown war project:
Currently only snapshot releases have been deployed to the repository(1.2-SNAPSHOT). Once we have some feedback that this is working OK, Iwill deploy a retrospective dojo 1.1.1 release and organize for that tobe mirrored to the central maven repositories. Until that time, youcan access the dojo repositories directly with the followingincantation in your pom.xml:
Currently only snapshot releases have been deployed to the repository (1.2-SNAPSHOT). Once we have some feedback that this is working OK, I will deploy a retrospective dojo 1.1.1 release and organize for that to be mirrored to the central maven repositories. Until that time, you can access the dojo repositories directly with the following incantation in your pom.xml:
<name>Dojo Maven2 Repository</name>
<name>Dojo Maven2 Snapshot Repository</name>
I am now using these artifacts to better mavenize the cometd projectand it's examples. Feedback on the repositories and the packaging ismost welcome.
Published at DZone with permission of Greg Wilkins . See the original article here.
Opinions expressed by DZone contributors are their own.