Simon Kitching schreef: > Jörg Schaible schrieb: >> Hi Hendrik, >> >> Hendrik Maryns wrote: >> >>> Hi, >>> >>> I have downloaded and edited Commons CLI. It works fine after some >>> configuring in Eclipse. Building from the command line, >>> however, fails, >>> both with Ant and with Maven. >>> >>> Ok, that is not entirely true: ant dist works in that it >>> produces a jar, >>> but: >>> junit-present: >>> [echo] ================================= WARNING >>> ================================ >>> [echo] Junit isn't present in your ${ANT_HOME}/lib >>> directory. Tests >>> not executed. >>> [echo] >>> ============================================================== >>> ============ >>> I tried putting junit.jar into /usr/share/ant/lib, but it still gives >>> this error. What can I do to get it to do the tests? >>> > I think this should have worked. Ant *does* require junit to be added to > its lib dir. Maybe you have multiple copies of ant? > And there are multiple versions of junit too; I would try junit-3.8.x, > not the 4.x series.
I have > ant -diagnostics ------- Ant diagnostics report ------- Apache Ant version 1.7.0 compiled on June 7 2008 ------------------------------------------- Implementation Version ------------------------------------------- core tasks : 1.7.0 optional tasks : not available ------------------------------------------- ANT PROPERTIES ------------------------------------------- ant.version: Apache Ant version 1.7.0 compiled on June 7 2008 ant.java.version: 1.6 ant.core.lib: /usr/share/java/ant-1.7.0.jar ant.home: /usr/share/ant I suppose ANT_HOME is the same as ant.home: /usr/share/ant, and the lib dir contains: > l /usr/share/ant/lib/ <snip> lrwxrwxrwx 1 root root 20 2008-10-16 13:42 junit.jar -> ../../java/junit.jar ~> l /usr/share/java/junit.jar lrwxrwxrwx 1 root root 15 2008-06-24 17:03 /usr/share/java/junit.jar -> junit-3.8.1.jar I even tried copying junit-3.8.1.jar into /usr/share/ant/lib explicitly, but still no luck. >>> Maven is more problematic. The README says to do mvn jar:jar. >> >> Really? Either call with Maven 1 "maven jar:jar" or with Maven 2 "mvn >> install". But maybe it's time to get rid of M1 entirely as supported >> build system. >> > +1 on ditching maven 1.x builds. It was never hugely popular and is a > pain to maintain. >>> ---------- >>> >>> If I try to do the default mvn clean install it starts out fine, but >>> complains about generics, which is obvious, because it gives javac >>> the switch -source 1.3!! >> >> This is the default for Maven. You have to configure the compiler (and >> javadoc) plugin to use 1.5 as source and target. We might add this in >> an profile of the parent POM that is activated if JDK 5 is used. >> > Making the source/target setting depend on the current jvm would defeat > the purpose. The point that CLI is currently intended to support the 1.3 > JVM, so obviously it is *good* for error to be reported if some > developer accidentally uses a java-1.5 feature, regardless of what > compiler they do the build with. Well, that will be my next rfe: upgrade CLI to use java 5 features. Hey, Java 5 is already end-of-life! > Hendrik, to enable java1.5 the magic configuration needed for maven 2.x is: > > <build> > <plugins> > <plugin> > <artifactId>maven-compiler-plugin</artifactId> > <version>2.0.2</version> > <configuration> > <source>1.5</source> > <target>1.5</target> > </configuration> > </plugin> I am really new to Maven, where do I put this? H. -- Hendrik Maryns http://tcl.sfs.uni-tuebingen.de/~hendrik/ ================== Ask smart questions, get good answers: http://www.catb.org/~esr/faqs/smart-questions.html
signature.asc
Description: OpenPGP digital signature