ftsrg / trainbenchmark-ttc

(Deprecated.) Framework for the TTC 2015 Train Benchmark case
Eclipse Public License 1.0
1 stars 8 forks source link

Can't compile my glue project anymore because dependencies aren't on classpath #5

Closed tsdh closed 9 years ago

tsdh commented 9 years ago

My solution glue project in my trainbenchmark-ttc fork used to work fine. But now I've changed some stuff in my solution and merged the latest changes from FTSRG/trainbenchmark-ttc into my fork, and since then, it won't compile because of errors like these:

[ERROR] /home/horn/Repos/uni/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/src/main/java/hu/bme/mit/trainbenchmark/ttc/benchmark/funnyqtglue/FunnyQTBenchmarkCase.java:[25,49] cannot find symbol
  symbol:   variable Clojure
  location: class hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue.FunnyQTBenchmarkCase

It seems that my solution's dependencies aren't fetched and added to the classpath anymore. And indeed, the target/ directory of my glue project doesn't contain a dependencies/ subfolder.

But I think I have my deps correctly declared. See my glue project's pom.xml. My solution is deployed to my local maven repository, and the transitive dependencies can all be fetched from there and from Clojars which I added as another repo here.

The maven output for my glue project is

[INFO] ------------------------------------------------------------------------
[INFO] Building hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Deleting /home/horn/Repos/uni/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /home/horn/Repos/uni/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING : 
[INFO] -------------------------------------------------------------

As you can see, it doesn't even try to fetch the declare dependencies.

Is there anything I'm doing wrong?

szarnyasg commented 9 years ago

I can build your solution compiles (with the tests turned off) using the following scripts. Note that it deletes your local Maven cache.

#!/bin/bash

### WARNING: this deletes your local Maven cache
rm -rf ~/.m2

mkdir funnyqt
cd funnyqt
git clone https://github.com/tsdh/ttc15-train-benchmark-funnyqt/
git clone git@github.com:tsdh/trainbenchmark-ttc.git
cd ttc15-train-benchmark-funnyqt/
lein install
ll ~/.m2/repository/ttc15-train-benchmark-funnyqt/ttc15-train-benchmark-funnyqt/0.1.0-SNAPSHOT/
cd ..
cd trainbenchmark-ttc/
mvn clean install -DskipTests

Some information on my system:

$ cat /etc/issue
Linux Mint 17.1 Rebecca \n \l
$ mvn -version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)
Maven home: /usr/share/maven3
Java version: 1.8.0_40, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-37-generic", arch: "amd64", family: "unix"
$ lein -version
Leiningen 2.5.1 on Java 1.8.0_40 Java HotSpot(TM) 64-Bit Server VM
tsdh commented 9 years ago

Well, I've ran the script once, and indeed the build succeeded. Then I pushed a new commit to my fork (first I rebased my master branch and then pushed it with --force), and now I get the same error again. Re-running the script now also exhibits the problems of my original issue although it's a completely new checkout...

[horn@thinkpad-t440p][0][:-)][9605](git)-[tsdh-master] 
[~/Repos/uni/trainbenchmark-ttc]% cat /etc/issue 
Arch Linux \r (\l)

[horn@thinkpad-t440p][0][:-)][9606](git)-[tsdh-master] 
[~/Repos/uni/trainbenchmark-ttc]% mvn -version
Apache Maven 3.3.1 (NON-CANONICAL_2015-03-18T18:27:34_root; 2015-03-18T16:27:34+01:00)
Maven home: /opt/maven
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.19.3-3-arch", arch: "amd64", family: "unix"

The maven output with the single execution that worked was:

[INFO] ------------------------------------------------------------------------
[INFO] Building hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/classes
[WARNING] /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/src/main/java/hu/bme/mit/trainbenchmark/ttc/benchmark/funnyqtglue/FunnyQTBenchmarkCase.java: /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/src/main/java/hu/bme/mit/trainbenchmark/ttc/benchmark/funnyqtglue/FunnyQTBenchmarkCase.java uses unchecked or unsafe operations.
[WARNING] /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/src/main/java/hu/bme/mit/trainbenchmark/ttc/benchmark/funnyqtglue/FunnyQTBenchmarkCase.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Building jar: /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue-1.0.0.jar
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:copy-dependencies (copy-dependencies) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Copying data.json-0.2.3.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/data.json-0.2.3.jar
[INFO] Copying core.logic-0.8.10.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/core.logic-0.8.10.jar
[INFO] Copying piggieback-0.1.3.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/piggieback-0.1.3.jar
[INFO] Copying args4j-2.0.16.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/args4j-2.0.16.jar
[INFO] Copying org.eclipse.emf.ecore.xmi-2.9.1.v20130827-0309.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/org.eclipse.emf.ecore.xmi-2.9.1.v20130827-0309.jar
[INFO] Copying tools.reader-0.8.3.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/tools.reader-0.8.3.jar
[INFO] Copying guava-18.0.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/guava-18.0.jar
[INFO] Copying jsr305-1.3.9.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/jsr305-1.3.9.jar
[INFO] Copying ttc15-train-benchmark-funnyqt-0.1.0-SNAPSHOT.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/ttc15-train-benchmark-funnyqt-0.1.0-SNAPSHOT.jar
[INFO] Copying closure-compiler-v20131014.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/closure-compiler-v20131014.jar
[INFO] Copying tools.macro-0.1.5.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/tools.macro-0.1.5.jar
[INFO] Copying clojurescript-0.0-2227.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/clojurescript-0.0-2227.jar
[INFO] Copying org.eclipse.emf.ecore-2.9.1.v20130827-0309.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/org.eclipse.emf.ecore-2.9.1.v20130827-0309.jar
[INFO] Copying hu.bme.mit.trainbenchmark.ttc.emf-1.0.0.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/hu.bme.mit.trainbenchmark.ttc.emf-1.0.0.jar
[INFO] Copying hamcrest-core-1.3.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/hamcrest-core-1.3.jar
[INFO] Copying clojure-1.7.0-beta1.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/clojure-1.7.0-beta1.jar
[INFO] Copying funnyqt-0.45.31.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/funnyqt-0.45.31.jar
[INFO] Copying austin-0.1.5.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/austin-0.1.5.jar
[INFO] Copying json-20090211.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/json-20090211.jar
[INFO] Copying useful-0.9.0.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/useful-0.9.0.jar
[INFO] Copying google-closure-library-third-party-0.0-20140226-71326067.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/google-closure-library-third-party-0.0-20140226-71326067.jar
[INFO] Copying tools.nrepl-0.2.3.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/tools.nrepl-0.2.3.jar
[INFO] Copying commons-codec-1.10.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/commons-codec-1.10.jar
[INFO] Copying org.eclipse.emf.common-2.9.1.v20130827-0309.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/org.eclipse.emf.common-2.9.1.v20130827-0309.jar
[INFO] Copying noencore-0.1.18.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/noencore-0.1.18.jar
[INFO] Copying data.priority-map-0.0.7.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/data.priority-map-0.0.7.jar
[INFO] Copying rhino-1.7R4.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/rhino-1.7R4.jar
[INFO] Copying google-closure-library-0.0-20140226-71326067.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/google-closure-library-0.0-20140226-71326067.jar
[INFO] Copying hu.bme.mit.trainbenchmark.ttc.emf.model-1.0.0.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/hu.bme.mit.trainbenchmark.ttc.emf.model-1.0.0.jar
[INFO] Copying ordered-1.5.2.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/ordered-1.5.2.jar
[INFO] Copying emf-xsd-sdk-2.10.1.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/emf-xsd-sdk-2.10.1.jar
[INFO] Copying jgralab-8.0.8.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/jgralab-8.0.8.jar
[INFO] Copying inflections-0.9.13.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/inflections-0.9.13.jar
[INFO] Copying commons-cli-1.2.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/commons-cli-1.2.jar
[INFO] Copying hu.bme.mit.trainbenchmark.ttc.benchmark-1.0.0.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/hu.bme.mit.trainbenchmark.ttc.benchmark-1.0.0.jar
[INFO] Copying protobuf-java-2.4.1.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/protobuf-java-2.4.1.jar
[INFO] Copying junit-4.12.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/junit-4.12.jar
[INFO] Copying core.cache-0.6.4.jar to /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/lib/core.cache-0.6.4.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue ---
[INFO] Installing /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/target/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue-1.0.0.jar to /home/horn/.m2/repository/hu/bme/mit/trainbenchmark/ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/1.0.0/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue-1.0.0.jar
[INFO] Installing /home/horn/tmp/funnyqt/trainbenchmark-ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/pom.xml to /home/horn/.m2/repository/hu/bme/mit/trainbenchmark/ttc/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue/1.0.0/hu.bme.mit.trainbenchmark.ttc.benchmark.funnyqtglue-1.0.0.pom

As you can see, in this single execution the maven-dependency-plugin:2.8:copy-dependencies (copy-dependencies) task has been performed (although this shows up after the compile task which seems very strange to me. How can it compile without errors if the dependencies aren't there yet?).

Anyway, when re-running your script after deleting the funnyqt/ directory which it creates for the checkouts, the copy-dependencies task isn't listed anymore in the maven output.

I don't know maven very well but this looks to me as if the order in which the tasks (or maven calls that goals, right?) are executed is arbitrary (based on hashCode() or something), and the single execution where the build succeeded was simply a lucky one.

tsdh commented 9 years ago

Ah, I'm too stupid. My last change accidentally removed an import clojure.java.api.Clojure; statement. So it works fine again. Sorry for the noise!

szarnyasg commented 9 years ago

No problem, Maven is very tricky and hard to debug -- last year we wasted days until we got our Maven/Tycho build right (and it was still slow and tedious to maintain).

tsdh commented 9 years ago

Maven is actually a great tool when used through Leiningen. But using it bare-bones is kind of a pain if you don't do that daily.

Anyway, good that it works again now. Then I can start writing the solution description. And the solution descriptions for the two other cases.