On Thu, Sep 2, 2010 at 2:24 PM, Stuart Sierra
<the.stua...@gmail.com> wrote:
> You'll need to adjust the version numbers for the Clojure
> dependencies. These are configured in clojure-contrib/modules/parent/
> pom.xml at the line:
>
> <properties>
> <clojure.version>1.2.0</clojure.version>
>
> Change that to 1.3.0-SNAPSHOT for the latest snapshot (including the
> ones you build locally) or set it to a specific snapshot version
> number from http://build.clojure.org/snapshots/org/clojure/clojure/1.3.0-master-SNAPSHOT/
I tried that with 1.3.0-master-SNAPSHOT and got:
[INFO] [clojure:compile {execution: compile-clojure}]
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/Compile
I cloned Clojure master and did ant, mvn install and I'm able to run
lein deps with :dependencies [[org.clojure/clojure
"1.3.0-master-SNAPSHOT"]] and projects run fine. So that part seems
fine.
I then got Clojure contrib master to build / install with Clojure
1.2.0 but then I couldn't figure out how to specify the dependency in
lein - it kept going off looking for remote versions of the
SNAPSHOT... Are we supposed to depend on specific modules now or is
there an overall contrib dependency we can use?
So, I guess, two questions:
* If I build contrib master against Clojure 1.2.0 (which works), how
do I specify the dependencies in lein?
* How do I successfully build contrib master against Clojure
1.3.0-master-SNAPSHOT?
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
This got answered (by Justin) in another thread so now I'm down to
just this question:
> * How do I successfully build contrib master against Clojure
> 1.3.0-master-SNAPSHOT?
Here's the top of my pom.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">
<modelVersion>4.0.0</modelVersion>
<properties>
<clojure.version>1.3.0-master-SNAPSHOT</clojure.version>
<!-- <clojure.version>1.2.0</clojure.version> -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<groupId>org.clojure.contrib</groupId>
<artifactId>parent</artifactId>
<version>1.3.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Clojure Contrib parent module</name>
<dependencies>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>${clojure.version}</version>
</dependency>
</dependencies>
I notice below that it has:
<build>
<resources>
<resource>
<directory>src/main/clojure</directory>
</resource>
<resource>
<directory>src/examples/clojure</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/clojure</directory>
</testResource>
</testResources>
That seems to imply there should be a src folder? Am I supposed to
copy Clojure into the same folder as contrib in order to do a build?
Having pulled Clojure master and done: ant, mvn install I saw that the
jar in the repository was very small - pretty much empty in fact. I
manually copied the clojure-1.3.0-master-SNAPSHOT.jar to the repo and
was able to mvn compile contrib just fine.
OK, good to know. Manually pushing the JAR into the local repo worked
and I was then able to build Clojure contrib master against the
Clojure master so I'm good to go now... on my laptop at least. I'll go
through this process on my desktop tomorrow and try that ant/maven
trick.
Here are the steps I took to build Clojure:
% git clone http://github.com/clojure/clojure.git
% cd clojure
[ downloaded maven-ant-tasks-2.1.1.jar and saved it here: /Users/
Shared/sw/maven-ant-tasks-2.1.1.jar ]
% ant -lib /Users/Shared/sw/maven-ant-tasks-2.1.1.jar ci-build
Verified that I now have an ~/.m2 directory tree, and it contains this
file, among others:
~/.m2/repository/org/clojure/clojure/1.3.0-master-SNAPSHOT/
clojure-1.3.0-master-SNAPSHOT.jar
Now try to use that to build contrib using these commands:
% cd ..
% git clone http://github.com/clojure/clojure-contrib.git
% cd clojure-contrib
I tried Stuart Sierra's suggestion from his Sep 2 email in this thread
to edit clojure-contrib/modules/parent/
pom.xml to change 1.2.0 to 1.3.0-master-SNAPSHOT. I noticed that it
still pulled down Clojure 1.2.0 during the build, so I looked for
other places in contrib that might be causing that, and found these:
% find . -name '*.xml' | xargs grep '1\.2'
./modules/condition/pom.xml: <version>1.2.0</version>
./modules/fnmap/pom.xml: <version>1.2.0</version>
./modules/jmx/pom.xml: <version>1.2.0</version>
./modules/parent/pom.xml: <clojure.version>1.2.0</clojure.version>
./modules/repl-ln/pom.xml: <version>1.2.0</version>
They all appeared to be specifying particular versions of Clojure, so
I decided to use a single command to replace them all in one go:
% find . -name '*.xml' | xargs perl -pi'.orig' -e 's/1.2.0/1.3.0-
master-SNAPSHOT/'
Then I tried building with this command:
% mvn -e install
This downloaded *lots* of stuff into my Maven repo, and built lots of
contrib modules, but it failed after about 8 minutes. I've appended
the errors from the end of the output below.
Any steps I'm doing wrong?
Thanks,
Andy
[INFO]
------------------------------------------------------------------------
[INFO] Building Unnamed - org.clojure.contrib:monads:jar:1.3.1-SNAPSHOT
[INFO] task-segment: [install]
[INFO]
------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] skip non existing resourceDirectory /Users/andy/sw/git/clojure-
contrib/modules/monads/src/examples/clojure
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [clojure:compile {execution: compile-clojure}]
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: /Users/andy/sw/git/clojure-contrib/
modules/monads/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] [clojure:test {execution: test-clojure}]
Exception in thread "main" java.lang.ClassNotFoundException:
clojure.set, compiling:(accumulators.clj:121)
at clojure.lang.Compiler.analyze(Compiler.java:5777)
at clojure.lang.Compiler.analyze(Compiler.java:5723)
at clojure.lang.Compiler$StaticInvokeExpr.parse(Compiler.java:3093)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3317)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:5945)
at clojure.lang.Compiler.analyze(Compiler.java:5762)
at clojure.lang.Compiler.analyze(Compiler.java:5723)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3331)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:5945)
at clojure.lang.Compiler.analyze(Compiler.java:5762)
at clojure.lang.Compiler.analyze(Compiler.java:5723)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5131)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:4639)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3449)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:5941)
at clojure.lang.Compiler.analyze(Compiler.java:5762)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:5931)
at clojure.lang.Compiler.analyze(Compiler.java:5762)
at clojure.lang.Compiler.analyze(Compiler.java:5723)
at clojure.lang.Compiler$HostExpr$Parser.parse(Compiler.java:847)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:5943)
at clojure.lang.Compiler.analyze(Compiler.java:5762)
at clojure.lang.Compiler.analyze(Compiler.java:5723)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5131)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:4639)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3449)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:5941)
at clojure.lang.Compiler.analyze(Compiler.java:5762)
at clojure.lang.Compiler.eval(Compiler.java:5995)
at clojure.lang.Compiler.load(Compiler.java:6431)
at clojure.lang.RT.loadResourceScript(RT.java:340)
at clojure.lang.RT.loadResourceScript(RT.java:331)
at clojure.lang.RT.load(RT.java:409)
at clojure.lang.RT.load(RT.java:381)
at clojure.core$load$fn__4395.invoke(core.clj:5298)
at clojure.core$load.doInvoke(core.clj:5297)
at clojure.lang.RestFn.invoke(RestFn.java:409)
at clojure.core$load_one.invoke(core.clj:5122)
at clojure.core$load_lib.doInvoke(core.clj:5159)
at clojure.lang.RestFn.applyTo(RestFn.java:143)
at clojure.core$apply.invokeStatic(core.clj:585)
at clojure.core$load_libs.doInvoke(core.clj:5193)
at clojure.lang.RestFn.applyTo(RestFn.java:138)
at clojure.core$apply.invokeStatic(core.clj:585)
at clojure.core$require.doInvoke(core.clj:5202)
at clojure.lang.RestFn.invoke(RestFn.java:409)
at clojure.contrib.monads
$eval11$loading__4294__auto____12.invoke(monads.clj:14)
at clojure.contrib.monads$eval11.invoke(monads.clj:14)
at clojure.lang.Compiler.eval(Compiler.java:5998)
at clojure.lang.Compiler.eval(Compiler.java:5989)
at clojure.lang.Compiler.load(Compiler.java:6431)
at clojure.lang.RT.loadResourceScript(RT.java:340)
at clojure.lang.RT.loadResourceScript(RT.java:331)
at clojure.lang.RT.load(RT.java:409)
at clojure.lang.RT.load(RT.java:381)
at clojure.core$load$fn__4395.invoke(core.clj:5298)
at clojure.core$load.doInvoke(core.clj:5297)
at clojure.lang.RestFn.invoke(RestFn.java:409)
at clojure.core$load_one.invoke(core.clj:5122)
at clojure.core$load_lib.doInvoke(core.clj:5159)
at clojure.lang.RestFn.applyTo(RestFn.java:143)
at clojure.core$apply.invokeStatic(core.clj:585)
at clojure.core$load_libs.doInvoke(core.clj:5193)
at clojure.lang.RestFn.applyTo(RestFn.java:138)
at clojure.core$apply.invokeStatic(core.clj:587)
at clojure.core$use.doInvoke(core.clj:5264)
at clojure.lang.RestFn.invoke(RestFn.java:422)
at clojure.contrib.test_monads
$eval5$loading__4294__auto____6.invoke(test_monads.clj:14)
at clojure.contrib.test_monads$eval5.invoke(test_monads.clj:14)
at clojure.lang.Compiler.eval(Compiler.java:5998)
at clojure.lang.Compiler.eval(Compiler.java:5989)
at clojure.lang.Compiler.load(Compiler.java:6431)
at clojure.lang.RT.loadResourceScript(RT.java:340)
at clojure.lang.RT.loadResourceScript(RT.java:331)
at clojure.lang.RT.load(RT.java:409)
at clojure.lang.RT.load(RT.java:381)
at clojure.core$load$fn__4395.invoke(core.clj:5298)
at clojure.core$load.doInvoke(core.clj:5297)
at clojure.lang.RestFn.invoke(RestFn.java:409)
at clojure.core$load_one.invoke(core.clj:5122)
at clojure.core$load_lib.doInvoke(core.clj:5159)
at clojure.lang.RestFn.applyTo(RestFn.java:143)
at clojure.core$apply.invokeStatic(core.clj:585)
at clojure.core$load_libs.doInvoke(core.clj:5193)
at clojure.lang.RestFn.applyTo(RestFn.java:138)
at clojure.core$apply.invokeStatic(core.clj:585)
at clojure.core$require.doInvoke(core.clj:5202)
at clojure.lang.RestFn.invoke(RestFn.java:409)
at user$eval1.invoke(run-test1162544732336955934.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:5998)
at clojure.lang.Compiler.load(Compiler.java:6431)
at clojure.lang.Compiler.loadFile(Compiler.java:6394)
at clojure.main$load_script.invoke(main.clj:216)
at clojure.main$script_opt.invoke(main.clj:268)
at clojure.main$main.doInvoke(main.clj:349)
at clojure.lang.RestFn.invoke(RestFn.java:409)
at clojure.lang.Var.invoke(Var.java:365)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
Caused by: java.lang.ClassNotFoundException: clojure.set
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:
58)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.classForName(RT.java:1596)
at clojure.lang.Compiler$HostExpr.maybeClass(Compiler.java:868)
at clojure.lang.Compiler$HostExpr.access$400(Compiler.java:669)
at clojure.lang.Compiler.analyzeSymbol(Compiler.java:6145)
at clojure.lang.Compiler.analyze(Compiler.java:5744)
... 99 more
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Clojure failed.
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Clojure failed.
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:
703)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor
.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor
.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor
.executeTaskSegments(DefaultLifecycleExecutor.java:332)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun
.reflect
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:
430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Clojure
failed.
at
com
.theoryinpractise
.clojure
.AbstractClojureCompilerMojo
.callClojureWith(AbstractClojureCompilerMojo.java:367)
at
com
.theoryinpractise
.clojure.ClojureRunTestMojo.execute(ClojureRunTestMojo.java:95)
at
org
.apache
.maven
.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:
678)
... 17 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 minutes 53 seconds
[INFO] Finished at: Wed Sep 22 18:02:41 PDT 2010
[INFO] Final Memory: 21M/37M
[INFO]
------------------------------------------------------------------------
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@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+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
On Sep 22, 2010, at 6:16 PM, Andy Fingerhut wrote:
> So I'm trying to start from a Mac OS X 10.5.8 system with java and
> mvn installed, but not Clojure, and with no Maven repo (i.e. ~/.m2
> does not exist yet), and trying to build the latest Clojure and
> contrib from the git repos using something as close to the
> recommended instructions that comes in those repos as I can find,
> plus what I've learned from this thread. I've gotten the latest
> Clojure to build and install in ~/.m2, but when I try to use that
> clojure-1.3.0-master-SNAPSHOT.jar to build contrib, it fails.
>
> Here are the steps I took to build Clojure:
>
> % git clone http://github.com/clojure/clojure.git
> % cd clojure
>
> [ downloaded maven-ant-tasks-2.1.1.jar and saved it here: /Users/
> Shared/sw/maven-ant-tasks-2.1.1.jar ]
>
> % ant -lib /Users/Shared/sw/maven-ant-tasks-2.1.1.jar ci-build
>
> Verified that I now have an ~/.m2 directory tree, and it contains
> this file, among others:
>
> ~/.m2/repository/org/clojure/clojure/1.3.0-master-SNAPSHOT/
> clojure-1.3.0-master-SNAPSHOT.jar
>
> Now try to use that to build contrib using these commands:
>
> % cd ..
> % git clone http://github.com/clojure/clojure-contrib.git
> % cd clojure-contrib
Now do this with the attached patch file:
% patch -p1 < clojure-contrib-patch.txt
% mvn install
After that, I had clojure, contrib, and a bunch of other dependencies
in my Maven repo in ~/.m2
I'm guessing that the "patch" step above will soon be unnecessary when
the contrib maintainers decide how best to improve it. I'm just going
for the quick and dirty fix here.
Andy
% mv ~/.m2/repository/org/clojure/contrib/complete/1.3.1-SNAPSHOT/
complete-1.3.1-SNAPSHOT-bin.jar ~/.m2/repository/org/clojure/contrib/
complete/1.3.1-SNAPSHOT/complete-1.3.1-SNAPSHOT.jar
% lein new myproj
% cd myproj
Now edit project.clj file so its :dependencies look like the one below.
:dependencies [[org.clojure/clojure "1.3.0-master-SNAPSHOT"]
[org.clojure.contrib/complete "1.3.1-SNAPSHOT"]])
Out of curiosity, I tried adding swank-clojure 1.2.1 in :dev-
dependencies, but I got a run time exception when trying 'lein
swank'. Not too surprising. 'lein repl' will have to do for now.
Andy
> <clojure-contrib-patch.txt>
According to another thread, the following works (but is "technically wrong"):
:dependencies [[org.clojure/clojure "1.3.0-master-SNAPSHOT"]
[org.clojure.contrib/complete "1.3.1-SNAPSHOT"
:classifier "bin"]])