commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <skitch...@apache.org>
Subject Re: [CLI] Building Commons CLI
Date Fri, 17 Oct 2008 14:02:58 GMT
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.

>> 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.

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>

Regards,
Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message