Re: ANN: clojure-maven-plugin 1.0 released and in maven central
ngocdaothanh napisał(a): I'm new to Maven. Thank you for the explanation. Using git-submodules and sourceDirectories is a good idea. Prior to using your plugin, I use clojure and clojure-contrib with Maven like this: 1. Manually download from GitHub and compile clojure and clojure- contrib. 2. Install them to the local Maven repository: mvn install:install-file -DgroupId=org.clojure -DartifactId=clojure - Dversion=SNAPSHOT -Dpackaging=jar -Dfile=clojure.jar mvn install:install-file -DgroupId=org.clojure -DartifactId=clojure- contrib -Dversion=SNAPSHOT -Dpackaging=jar -Dfile=clojure-contrib.jar 3. Add clojure and clojure-contrib and other dependencies that my project uses in pom.xml: ... dependencies dependency groupIdorg.clojure/groupId artifactIdclojure/artifactId versionSNAPSHOT/version /dependency dependency groupIdorg.clojure/groupId artifactIdclojure-contrib/artifactId versionSNAPSHOT/version /dependency ... /dependencies ... 4. Use Exec Maven Plugin (http://mojo.codehaus.org/exec-maven-plugin/) to run my Clojure file: mvn exec:java -Dexec.mainClass=clojure.main -Dexec.args=path/to/my/ clojure/file.clj I want to ask is there a better way to use clojure and clojure-contrib and running Clojure file with Maven? Actually I managed to make a little bit more useful pom-template.xml (from clojure git repository) and now I'm able to install clojure in local maven repository just using this commands: $ git pull $ ant init-version $ mvn install I'm going to change pom.xml in clojure-contrib in the same way. Needed XMLs look as follows: # clojure-jar.xml - assembly descriptor assembly formats formatjar/format /formats includeBaseDirectoryfalse/includeBaseDirectory fileSets fileSet directory${build}/directory outputDirectory/outputDirectory includes include**/*.class/include /includes /fileSet fileSet directory${cljsrc}/directory outputDirectory/outputDirectory includes include**/*.clj/include includeclojure/version.properties/include /includes /fileSet /fileSets /assembly # slim-jar.xml - assembly descriptor assembly formats formatjar/format /formats includeBaseDirectoryfalse/includeBaseDirectory fileSets fileSet directory${build}/directory outputDirectory/outputDirectory includes includeclojure/asm/**/include includeclojure/lang/**/include includeclojure/main.class/include /includes /fileSet fileSet directory${cljsrc}/directory outputDirectory/outputDirectory includes include**/*.clj/include includeclojure/version.properties/include /includes /fileSet /fileSets /assembly # pom-template.xml ?xml version=1.0 encoding=UTF-8? 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; modelVersion4.0.0/modelVersion groupIdorg.clojure/groupId artifactIdclojure-lang/artifactId nameclojure-lang/name version@clojure-version@/version urlhttp://clojure.org//url packagingpom/packaging descriptionClojure core environment and runtime library./ description licenses license nameEclipse Public License 1.0/name urlhttp://opensource.org/licenses/eclipse-1.0.php/url distributionrepo/distribution /license /licenses properties srcsrc/src testtest/test jsrc${src}/jvm/jsrc cljsrc${src}/clj/cljsrc buildclasses/build clojure_jarclojure-${project.version}/clojure_jar slim_jarclojure-slim-${project.version}/slim_jar /properties repositories repository idtapestry-snapshots/id urlhttp://tapestry.formos.com/maven-snapshot-repository// url /repository /repositories distributionManagement repository idreleases/id namerelease/name urlhttp://localhost:8081/nexus/content/repositories/releases/ /url /repository snapshotRepository idsnapshots/id namesnapshot/name urlhttp://localhost:8081/nexus/content/repositories/ snapshots//url /snapshotRepository /distributionManagement build sourceDirectory${jsrc}/sourceDirectory outputDirectory${build}/outputDirectory plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration debugtrue/debug source1.5/source target1.5/target /configuration executions execution idcompile-java/id phasecompile/phase goals
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
Excellent, thanks Mark for this contribution ! When time permits, I'll undoubtedly give a thorough look at it, and see how I can integrate this with Counterclockwise (new name for clojure-dev eclipse plugin). Something like a mvn clojure:eclipse that could extend the eclipse:eclipse goal for initializing the eclipse project with the clojure nature, and use the provided strategy for resolving namespaces to compile. Regards, -- Laurent 2009/8/24 Mark Derricutt m...@talios.com Hey all, I've released 1.0 of my clojure-maven-plugin and its now available in maven-central. To use it, a minimal pom.xml declaring a dependency on clojure, and the the plugin (without configuration) is all you need. - http://gist.github.com/174217 With the above pom, running mvn clojure:compile will scan any .clj file under ./src/main/clojure and compile them into the ./target/classes directory. mvn clojure:test-compile will do the same for any .clj file under ./src/test/clojure. For more options such as hooking up a test script, filtering namespaces etc. see the project site at: http://github.com/talios/clojure-maven-plugin Mark -- Discouragement is a dissatisfaction with the past, a distaste for the present, and a distrust of the future - Maree De Jong, Life NZ. blog: http://www.talios.com podcast: http://www.illegalargument.com skype / twitter: talios --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
For a bleeding edge/nightly build of clojure-lang and clojure-contrib I'm using the repository at: http://tapestry.formos.com/maven-snapshot-repository groupId of org.clojure artifact of clojure-lang / clojure-contrib -- On Tue, Aug 25, 2009 at 5:35 PM, ngocdaothanh ngocdaoth...@gmail.comwrote: I want to ask is there a better way to use clojure and clojure-contrib and running Clojure file with Maven? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
For my own usages I've just been using IDEAs native maven support and opening the pom.xml - This sadly doesn't pick up the source directories thou. -- On Tue, Aug 25, 2009 at 7:33 PM, Laurent PETIT laurent.pe...@gmail.comwrote: Excellent, thanks Mark for this contribution ! When time permits, I'll undoubtedly give a thorough look at it, and see how I can integrate this with Counterclockwise (new name for clojure-dev eclipse plugin). Something like a mvn clojure:eclipse that could extend the eclipse:eclipse goal for initializing the eclipse project with the clojure nature, and use the provided strategy for resolving namespaces to compile. Regards, -- Laurent 2009/8/24 Mark Derricutt m...@talios.com Hey all, I've released 1.0 of my clojure-maven-plugin and its now available in maven-central. To use it, a minimal pom.xml declaring a dependency on clojure, and the the plugin (without configuration) is all you need. - http://gist.github.com/174217 With the above pom, running mvn clojure:compile will scan any .clj file under ./src/main/clojure and compile them into the ./target/classes directory. mvn clojure:test-compile will do the same for any .clj file under ./src/test/clojure. For more options such as hooking up a test script, filtering namespaces etc. see the project site at: http://github.com/talios/clojure-maven-plugin Mark -- Discouragement is a dissatisfaction with the past, a distaste for the present, and a distrust of the future - Maree De Jong, Life NZ. blog: http://www.talios.com podcast: http://www.illegalargument.com skype / twitter: talios --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
How does it work if you have both Java and Clojure code in the same project? Which is compiled first? On Tue, Aug 25, 2009 at 12:46 PM, Mark Derricuttm...@talios.com wrote: For my own usages I've just been using IDEAs native maven support and opening the pom.xml - This sadly doesn't pick up the source directories thou. -- On Tue, Aug 25, 2009 at 7:33 PM, Laurent PETIT laurent.pe...@gmail.com wrote: Excellent, thanks Mark for this contribution ! When time permits, I'll undoubtedly give a thorough look at it, and see how I can integrate this with Counterclockwise (new name for clojure-dev eclipse plugin). Something like a mvn clojure:eclipse that could extend the eclipse:eclipse goal for initializing the eclipse project with the clojure nature, and use the provided strategy for resolving namespaces to compile. Regards, -- Laurent 2009/8/24 Mark Derricutt m...@talios.com Hey all, I've released 1.0 of my clojure-maven-plugin and its now available in maven-central. To use it, a minimal pom.xml declaring a dependency on clojure, and the the plugin (without configuration) is all you need. - http://gist.github.com/174217 With the above pom, running mvn clojure:compile will scan any .clj file under ./src/main/clojure and compile them into the ./target/classes directory. mvn clojure:test-compile will do the same for any .clj file under ./src/test/clojure. For more options such as hooking up a test script, filtering namespaces etc. see the project site at: http://github.com/talios/clojure-maven-plugin Mark -- Discouragement is a dissatisfaction with the past, a distaste for the present, and a distrust of the future - Maree De Jong, Life NZ. blog: http://www.talios.com podcast: http://www.illegalargument.com skype / twitter: talios -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
If you have the clojure:compile goal bound to the compile phase it runs -after- the normal java compiler. One solution I've used is just using multiple modules and keeping the clojure code separate from the java. However, if your only talking TO java from clojure this might not be a problem. -- On Tue, Aug 25, 2009 at 11:06 PM, Christian Vest Hansen karmazi...@gmail.com wrote: How does it work if you have both Java and Clojure code in the same project? Which is compiled first? On Tue, Aug 25, 2009 at 12:46 PM, Mark Derricuttm...@talios.com wrote: For my own usages I've just been using IDEAs native maven support and opening the pom.xml - This sadly doesn't pick up the source directories thou. -- On Tue, Aug 25, 2009 at 7:33 PM, Laurent PETIT laurent.pe...@gmail.com wrote: Excellent, thanks Mark for this contribution ! When time permits, I'll undoubtedly give a thorough look at it, and see how I can integrate this with Counterclockwise (new name for clojure-dev eclipse plugin). Something like a mvn clojure:eclipse that could extend the eclipse:eclipse goal for initializing the eclipse project with the clojure nature, and use the provided strategy for resolving namespaces to compile. Regards, -- Laurent 2009/8/24 Mark Derricutt m...@talios.com Hey all, I've released 1.0 of my clojure-maven-plugin and its now available in maven-central. To use it, a minimal pom.xml declaring a dependency on clojure, and the the plugin (without configuration) is all you need. - http://gist.github.com/174217 With the above pom, running mvn clojure:compile will scan any .clj file under ./src/main/clojure and compile them into the ./target/classes directory. mvn clojure:test-compile will do the same for any .clj file under ./src/test/clojure. For more options such as hooking up a test script, filtering namespaces etc. see the project site at: http://github.com/talios/clojure-maven-plugin Mark -- Discouragement is a dissatisfaction with the past, a distaste for the present, and a distrust of the future - Maree De Jong, Life NZ. blog: http://www.talios.com podcast: http://www.illegalargument.com skype / twitter: talios -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
This makes me think about a possible improvement. (stop me if I'm wrong). I think that your java source classes will only have a compilation dependency on clojure source if your clojure source generates classes or interfaces via gen-class / gen-interface. (If there are other kind of dependencies *for the java compilation* I'm not aware of, then my whole suggestion may collapse). So if you expect from your users to keep the gen-class / gen-interface declarations separate from the implementation, everything can go OK. In fact, I've already used this pattern succesfully at work. So at the cost of an optional set of directories/patterns for identifying pure gen-class / gen-interface namespaces in the maven pom, you could automate it correctly : * first compile all the pure gen-class/gen-interface namespaces (the only dependencies these namespaces can have are towards other pure gen-class/gen-interface namespaces, and third-party namespaces java maven artifacts declared in the pom. * then compile the java source files normally. * then compile the rest of the clojure files, whose dependencies towards project's specific java artifacts will succesfully be found. The only thing not covered by the above scenario is if you have, for example, the java source files of your project creating new classes or interfaces you want to extend/implement via gen-class/gen-interface. This was not a problem in my use case, since the only interfaces/classes I wanted to extend were those provided by third-party frameworks, not my own code. Regards, -- Laurent 2009/8/25 Mark Derricutt m...@talios.com If you have the clojure:compile goal bound to the compile phase it runs -after- the normal java compiler. One solution I've used is just using multiple modules and keeping the clojure code separate from the java. However, if your only talking TO java from clojure this might not be a problem. -- On Tue, Aug 25, 2009 at 11:06 PM, Christian Vest Hansen karmazi...@gmail.com wrote: How does it work if you have both Java and Clojure code in the same project? Which is compiled first? On Tue, Aug 25, 2009 at 12:46 PM, Mark Derricuttm...@talios.com wrote: For my own usages I've just been using IDEAs native maven support and opening the pom.xml - This sadly doesn't pick up the source directories thou. -- On Tue, Aug 25, 2009 at 7:33 PM, Laurent PETIT laurent.pe...@gmail.com wrote: Excellent, thanks Mark for this contribution ! When time permits, I'll undoubtedly give a thorough look at it, and see how I can integrate this with Counterclockwise (new name for clojure-dev eclipse plugin). Something like a mvn clojure:eclipse that could extend the eclipse:eclipse goal for initializing the eclipse project with the clojure nature, and use the provided strategy for resolving namespaces to compile. Regards, -- Laurent 2009/8/24 Mark Derricutt m...@talios.com Hey all, I've released 1.0 of my clojure-maven-plugin and its now available in maven-central. To use it, a minimal pom.xml declaring a dependency on clojure, and the the plugin (without configuration) is all you need. - http://gist.github.com/174217 With the above pom, running mvn clojure:compile will scan any .clj file under ./src/main/clojure and compile them into the ./target/classes directory. mvn clojure:test-compile will do the same for any .clj file under ./src/test/clojure. For more options such as hooking up a test script, filtering namespaces etc. see the project site at: http://github.com/talios/clojure-maven-plugin Mark -- Discouragement is a dissatisfaction with the past, a distaste for the present, and a distrust of the future - Maree De Jong, Life NZ. blog: http://www.talios.com podcast: http://www.illegalargument.com skype / twitter: talios -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
Hi Mark Thank you for the effort! A Meven plugin is something really needed for any Java environment. Can you please update the example roject, since the default settings (the ones from the above-mentioned gist and the docs) does not seem to work as expected. Here's what I mean. I have a project that's built with the previous version of your plugin. There are a few thing to set up (and thanks for the provided examples :), a bit messy but in the end workable. Expected behavior was (at least): mvn test - compiles clj files from src/main/clojure and src/test/ clojure and runs the tests from the provided all_tests.clj mvn install - compiles, tests, packages etc... Now, I've converted the project to the new version of clojure-maven- plugin Problems: 1. If I use the defaults, mvn test install etc do not catch anything clj 2. clojure:compile compiles but clojure:test results with an error I know that something should be set/hooked up etc (as you mentioned) but there is no example. Maven is, with all its quirks, very popular for the sole reason that it provides reasonable defaults for everything. Can you, please, update the example so we can see exactly how to hook up clojure:test etc. with respective java: tasks? And, even better, is there a way to set the defaults in the plugin itself, so these tasks are hooked up automagically? :) And again, thank you for taking time in the development of this plugin :) On Aug 25, 1:15 pm, Mark Derricutt m...@talios.com wrote: If you have the clojure:compile goal bound to the compile phase it runs -after- the normal java compiler. One solution I've used is just using multiple modules and keeping the clojure code separate from the java. However, if your only talking TO java from clojure this might not be a problem. -- On Tue, Aug 25, 2009 at 11:06 PM, Christian Vest Hansen karmazi...@gmail.com wrote: How does it work if you have both Java and Clojure code in the same project? Which is compiled first? On Tue, Aug 25, 2009 at 12:46 PM, Mark Derricuttm...@talios.com wrote: For my own usages I've just been using IDEAs native maven support and opening the pom.xml - This sadly doesn't pick up the source directories thou. -- On Tue, Aug 25, 2009 at 7:33 PM, Laurent PETIT laurent.pe...@gmail.com wrote: Excellent, thanks Mark for this contribution ! When time permits, I'll undoubtedly give a thorough look at it, and see how I can integrate this with Counterclockwise (new name for clojure-dev eclipse plugin). Something like a mvn clojure:eclipse that could extend the eclipse:eclipse goal for initializing the eclipse project with the clojure nature, and use the provided strategy for resolving namespaces to compile. Regards, -- Laurent 2009/8/24 Mark Derricutt m...@talios.com Hey all, I've released 1.0 of my clojure-maven-plugin and its now available in maven-central. To use it, a minimal pom.xml declaring a dependency on clojure, and the the plugin (without configuration) is all you need. -http://gist.github.com/174217 With the above pom, running mvn clojure:compile will scan any .clj file under ./src/main/clojure and compile them into the ./target/classes directory. mvn clojure:test-compile will do the same for any .clj file under ./src/test/clojure. For more options such as hooking up a test script, filtering namespaces etc. see the project site at: http://github.com/talios/clojure-maven-plugin Mark -- Discouragement is a dissatisfaction with the past, a distaste for the present, and a distrust of the future - Maree De Jong, Life NZ. blog:http://www.talios.com podcast:http://www.illegalargument.com skype / twitter: talios -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
In this scenario, I'd probably not try to fight maven and split this into two modules - api and implementation. Even in a pure java project I'm tempted to keep them separate (esp. with the OSGi stuff I'm doing, it looks like this would solve more of our reloading issues). As the plugin stands currently, you -could- bind clojure:compile with a limited set of namespaces to say the generate-sources phase (I really wish maven had a of before/after compile phase, and also bind it to the normal compile phase. That would get you the functionality you want in a single module, it's not very pretty to hijack the generate-sources phase like that thou. -- Pull me down under... On Wed, Aug 26, 2009 at 12:03 AM, Laurent PETIT laurent.pe...@gmail.comwrote: * first compile all the pure gen-class/gen-interface namespaces (the only dependencies these namespaces can have are towards other pure gen-class/gen-interface namespaces, and third-party namespaces java maven artifacts declared in the pom. * then compile the java source files normally. * then compile the rest of the clojure files, whose dependencies towards project's specific java artifacts will succesfully be found. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
Hi Dragan, The example projects been updated with a repository declaration pointing to the clojure snapshots, and using the released plugin version. Running mvn test runs the tests as expected. You mentioned Can you, please, update the example so we can see exactly how to hook up clojure:test etc. with respective java: tasks? - do you mean also having JUnit/TestNG tests? They should just run as normal. As for running clojure:compile and clojure:test automatically, that can't be done without creating a custom lifecycle (afaik) which can only be triggered by having a different packaging type - which means its not really practical. -- Pull me down under... On Wed, Aug 26, 2009 at 12:05 AM, Dragan Djuric draga...@gmail.com wrote: Can you please update the example roject, since the default settings (the ones from the above-mentioned gist and the docs) does not seem to work as expected. Here's what I mean. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
ANN: clojure-maven-plugin 1.0 released and in maven central
Hey all, I've released 1.0 of my clojure-maven-plugin and its now available in maven-central. To use it, a minimal pom.xml declaring a dependency on clojure, and the the plugin (without configuration) is all you need. - http://gist.github.com/174217 With the above pom, running mvn clojure:compile will scan any .clj file under ./src/main/clojure and compile them into the ./target/classes directory. mvn clojure:test-compile will do the same for any .clj file under ./src/test/clojure. For more options such as hooking up a test script, filtering namespaces etc. see the project site at: http://github.com/talios/clojure-maven-plugin Mark -- Discouragement is a dissatisfaction with the past, a distaste for the present, and a distrust of the future - Maree De Jong, Life NZ. blog: http://www.talios.com podcast: http://www.illegalargument.com skype / twitter: talios --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
Hi, Is clojure-contrib included? I tried but mvn clojure:compile gives: Exception in thread main java.io.FileNotFoundException: Could not locate clojure/contrib/json/read__init.class or clojure/contrib/json/ read.clj on classpath pom.xml: http://gist.github.com/174217 hello.clj: (ns hello) (use 'clojure.contrib.json.read) (read-json {\x\: 1}) Thanks. On Aug 25, 6:28 am, Mark Derricutt m...@talios.com wrote: Hey all, I've released 1.0 of my clojure-maven-plugin and its now available in maven-central. To use it, a minimal pom.xml declaring a dependency on clojure, and the the plugin (without configuration) is all you need. -http://gist.github.com/174217 With the above pom, running mvn clojure:compile will scan any .clj file under ./src/main/clojure and compile them into the ./target/classes directory. mvn clojure:test-compile will do the same for any .clj file under ./src/test/clojure. For more options such as hooking up a test script, filtering namespaces etc. see the project site at: http://github.com/talios/clojure-maven-plugin Mark -- Discouragement is a dissatisfaction with the past, a distaste for the present, and a distrust of the future - Maree De Jong, Life NZ. blog:http://www.talios.com podcast:http://www.illegalargument.com skype / twitter: talios --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
The plugin itself has NO dependency on clojure or clojure contrib so you'll need to add them to your own pom.xml first. This is mostly because a) clojure contrib hasn't been released or in maven central, b) I'm using clojure 1.1 on my own projects which isn't released. For my own projects, I have compojure and some other libs included as git-submodules in my repository, and have configured additional sourceDirectories to compile. -- On Tue, Aug 25, 2009 at 4:19 PM, ngocdaothanh ngocdaoth...@gmail.comwrote: Is clojure-contrib included? I tried but mvn clojure:compile gives: Exception in thread main java.io.FileNotFoundException: Could not locate clojure/contrib/json/read__init.class or clojure/contrib/json/ read.clj on classpath --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: ANN: clojure-maven-plugin 1.0 released and in maven central
I'm new to Maven. Thank you for the explanation. Using git-submodules and sourceDirectories is a good idea. Prior to using your plugin, I use clojure and clojure-contrib with Maven like this: 1. Manually download from GitHub and compile clojure and clojure- contrib. 2. Install them to the local Maven repository: mvn install:install-file -DgroupId=org.clojure -DartifactId=clojure - Dversion=SNAPSHOT -Dpackaging=jar -Dfile=clojure.jar mvn install:install-file -DgroupId=org.clojure -DartifactId=clojure- contrib -Dversion=SNAPSHOT -Dpackaging=jar -Dfile=clojure-contrib.jar 3. Add clojure and clojure-contrib and other dependencies that my project uses in pom.xml: ... dependencies dependency groupIdorg.clojure/groupId artifactIdclojure/artifactId versionSNAPSHOT/version /dependency dependency groupIdorg.clojure/groupId artifactIdclojure-contrib/artifactId versionSNAPSHOT/version /dependency ... /dependencies ... 4. Use Exec Maven Plugin (http://mojo.codehaus.org/exec-maven-plugin/) to run my Clojure file: mvn exec:java -Dexec.mainClass=clojure.main -Dexec.args=path/to/my/ clojure/file.clj I want to ask is there a better way to use clojure and clojure-contrib and running Clojure file with Maven? On Aug 25, 1:54 pm, Mark Derricutt m...@talios.com wrote: The plugin itself has NO dependency on clojure or clojure contrib so you'll need to add them to your own pom.xml first. This is mostly because a) clojure contrib hasn't been released or in maven central, b) I'm using clojure 1.1 on my own projects which isn't released. For my own projects, I have compojure and some other libs included as git-submodules in my repository, and have configured additional sourceDirectories to compile. -- On Tue, Aug 25, 2009 at 4:19 PM, ngocdaothanh ngocdaoth...@gmail.comwrote: Is clojure-contrib included? I tried but mvn clojure:compile gives: Exception in thread main java.io.FileNotFoundException: Could not locate clojure/contrib/json/read__init.class or clojure/contrib/json/ read.clj on classpath --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---