You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gianfranco Oldani <gf...@hotmail.com> on 2006/03/19 19:38:15 UTC

Maven 2 and java 1.5 Annotations

Hi all,
I use maven 2 and it need to compile sources with annotations (JUnit 4.0 
annotations) and I get always this message:

notations are not supported in -source 1.3
(try -source 1.5 to enable annotations)
    @Before public void setUp()

I use JDK 1.5.0_04.

Somebody can help? Thanks for help

Gianfranco OLDANI
Mob: +41787330350
Web: www.gfoldani.com

_________________________________________________________________
Sélectionnez les meilleurs albums pour votre discothèque MP3 en ligne! 
http://sib1.od2.com/common/Framework.aspx?shid=0045002E


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 and java 1.5 Annotations

Posted by Wendy Smoak <ws...@gmail.com>.
On 3/19/06, Gianfranco Oldani <gf...@hotmail.com> wrote:
> Hi all,
> I use maven 2 and it need to compile sources with annotations (JUnit 4.0
> annotations) and I get always this message:
>
> notations are not supported in -source 1.3
> (try -source 1.5 to enable annotations)
>     @Before public void setUp()

This page has an example of configuring the compiler plugin for JDK 1.5:
 * http://maven.apache.org/plugins/maven-compiler-plugin/howto.html

--
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 and java 1.5 Annotations

Posted by gilles_gty <Gi...@unicible.ch>.

Eric Redmond wrote:
> 
> You mean JUnit 4? Annotations are brand new with JUnit 4, and if it is not
> yet supported, neither will be annotations.
> 

Correct. I mean JUnit 4.0. My mistake.
OK. I understand I used JUnit 4.0 cookbook not yet ported Maven and/or
Surefire. 

Maybe there is a way to tell Surefire to use JUnit 4.0 for running the tests
as opposed to an older version ?

Regards
Gilles

--
View this message in context: http://www.nabble.com/Maven-2-and-java-1.5-Annotations-t1307356.html#a4884157
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 and java 1.5 Annotations

Posted by Eric Redmond <er...@gmail.com>.
You mean JUnit 4? Annotations are brand new with JUnit 4, and if it is not
yet supported, neither will be annotations.

Eric

On 6/15/06, gilles_gty <Gi...@unicible.ch> wrote:
>
>
> Hi there.
>
> I am rather new with Maven 2. No Ant neither Maven 1 background.
>
> Did any one got this annotation stuff to work ? Using Maven 2 + Java 1.5 +
> Junit 1.4.
> I fixed my PATH, the JAVA_HOME, also the source + target parameters. I
> think
> the test gets compiled with Junit 1.4 but get ran with prior version.
>
> I observe even though I specify in my pom.xml a Junit version of 1.4, that
> Maven downloads both 1.4 _and_  3.8.1 junit artifact versions. I can not
> pin
> point where this version or dependency or ? is defined.
>
> Things are going rather fine : compiling, running tests ( from maven 2
> cook
> book examples ). Only glitch is :  annotation seams to be ignored. I built
> an "expected exception" example, I am getting the excption right, but it
> makes my test a failure instead of a success.
>
> ==
>    @org.junit.Test(expected=NullPointerException.class)
>    public void test_nullpointerexception() {
>        App foo = null;
>        foo.getValeur();
>    }
> ==
>
> I understand the Surefire JIRA issue is this one :
> http://jira.codehaus.org/browse/MSUREFIRE-84
> leading me to believe Junit 1.4 is not yet fully usable within Surefire ?
> Any one concuring ?
>
> Thanks for time and consideration.
>
> Gilles
> Wayne Fay wrote:
> >
> > Brett can probably comment more on this, as I believe he has been
> > working on this (Surefire) a bit lately, but I believe the comment
> > "test plugin doesn't use 4.0 (yet)" is probably along the right lines.
> >
> > There's probably a Maven JIRA you could find and watch so you'd know
> > when JUnit 4.0 is fully integrated and functional.
> >
> > Wayne
> >
> >
> > On 3/20/06, Thorsten Heit <th...@xtramind.com> wrote:
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> Hi,
> >>
> >> > Hello Subhash,
> >> > Thanks a lot it works. You have probably more experience than me with
> >> > JUnit 4 and maven. I would ask you another question. I have written
> my
> >> > test class as described in the cookbook (for 4.0) by Kent Beck, Erich
> >> > Gamma on the JUnit web site but I have still to prefix all my testing
> >> > method by the "test" keyword. Its like if the annotations were
> ignored.
> >> > An idea?
> >>
> >> Perhaps the test plugin doesn't use or know the existence of JUnit 4.0
> >> and still uses 3.8.x? Just an idea, haven't testet it...
> >>
> >>
> >> Thorsten
> >> -----BEGIN PGP SIGNATURE-----
> >> Version: GnuPG v1.4.2.2 (MingW32)
> >>
> >> iD8DBQFEHoc8QvObkgCcDe0RAjX7AKDrghITbKicv74t9DMgrpH0Cp/+zACeKuID
> >> FiT2nc06AtOiF3bjdmLO+pY=
> >> =dgTh
> >> -----END PGP SIGNATURE-----
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
> --
> View this message in context:
> http://www.nabble.com/Maven-2-and-java-1.5-Annotations-t1307356.html#a4880333
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven 2 and java 1.5 Annotations

Posted by gilles_gty <Gi...@unicible.ch>.
Hi there. 

I am rather new with Maven 2. No Ant neither Maven 1 background.

Did any one got this annotation stuff to work ? Using Maven 2 + Java 1.5 +
Junit 1.4.
I fixed my PATH, the JAVA_HOME, also the source + target parameters. I think
the test gets compiled with Junit 1.4 but get ran with prior version.

I observe even though I specify in my pom.xml a Junit version of 1.4, that
Maven downloads both 1.4 _and_  3.8.1 junit artifact versions. I can not pin
point where this version or dependency or ? is defined.

Things are going rather fine : compiling, running tests ( from maven 2 cook
book examples ). Only glitch is :  annotation seams to be ignored. I built
an "expected exception" example, I am getting the excption right, but it
makes my test a failure instead of a success.

==
   @org.junit.Test(expected=NullPointerException.class)
   public void test_nullpointerexception() { 
       App foo = null; 
       foo.getValeur();
   }
==

I understand the Surefire JIRA issue is this one :
http://jira.codehaus.org/browse/MSUREFIRE-84
leading me to believe Junit 1.4 is not yet fully usable within Surefire ?
Any one concuring ?

Thanks for time and consideration.

Gilles
Wayne Fay wrote:
> 
> Brett can probably comment more on this, as I believe he has been
> working on this (Surefire) a bit lately, but I believe the comment
> "test plugin doesn't use 4.0 (yet)" is probably along the right lines.
> 
> There's probably a Maven JIRA you could find and watch so you'd know
> when JUnit 4.0 is fully integrated and functional.
> 
> Wayne
> 
> 
> On 3/20/06, Thorsten Heit <th...@xtramind.com> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hi,
>>
>> > Hello Subhash,
>> > Thanks a lot it works. You have probably more experience than me with
>> > JUnit 4 and maven. I would ask you another question. I have written my
>> > test class as described in the cookbook (for 4.0) by Kent Beck, Erich
>> > Gamma on the JUnit web site but I have still to prefix all my testing
>> > method by the "test" keyword. Its like if the annotations were ignored.
>> > An idea?
>>
>> Perhaps the test plugin doesn't use or know the existence of JUnit 4.0
>> and still uses 3.8.x? Just an idea, haven't testet it...
>>
>>
>> Thorsten
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.2.2 (MingW32)
>>
>> iD8DBQFEHoc8QvObkgCcDe0RAjX7AKDrghITbKicv74t9DMgrpH0Cp/+zACeKuID
>> FiT2nc06AtOiF3bjdmLO+pY=
>> =dgTh
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
--
View this message in context: http://www.nabble.com/Maven-2-and-java-1.5-Annotations-t1307356.html#a4880333
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 and java 1.5 Annotations

Posted by Wayne Fay <wa...@gmail.com>.
Brett can probably comment more on this, as I believe he has been
working on this (Surefire) a bit lately, but I believe the comment
"test plugin doesn't use 4.0 (yet)" is probably along the right lines.

There's probably a Maven JIRA you could find and watch so you'd know
when JUnit 4.0 is fully integrated and functional.

Wayne


On 3/20/06, Thorsten Heit <th...@xtramind.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> > Hello Subhash,
> > Thanks a lot it works. You have probably more experience than me with
> > JUnit 4 and maven. I would ask you another question. I have written my
> > test class as described in the cookbook (for 4.0) by Kent Beck, Erich
> > Gamma on the JUnit web site but I have still to prefix all my testing
> > method by the "test" keyword. Its like if the annotations were ignored.
> > An idea?
>
> Perhaps the test plugin doesn't use or know the existence of JUnit 4.0
> and still uses 3.8.x? Just an idea, haven't testet it...
>
>
> Thorsten
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (MingW32)
>
> iD8DBQFEHoc8QvObkgCcDe0RAjX7AKDrghITbKicv74t9DMgrpH0Cp/+zACeKuID
> FiT2nc06AtOiF3bjdmLO+pY=
> =dgTh
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven 2 and java 1.5 Annotations

Posted by Thorsten Heit <th...@xtramind.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

> Hello Subhash,
> Thanks a lot it works. You have probably more experience than me with
> JUnit 4 and maven. I would ask you another question. I have written my
> test class as described in the cookbook (for 4.0) by Kent Beck, Erich
> Gamma on the JUnit web site but I have still to prefix all my testing
> method by the "test" keyword. Its like if the annotations were ignored.
> An idea?

Perhaps the test plugin doesn't use or know the existence of JUnit 4.0
and still uses 3.8.x? Just an idea, haven't testet it...


Thorsten
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)

iD8DBQFEHoc8QvObkgCcDe0RAjX7AKDrghITbKicv74t9DMgrpH0Cp/+zACeKuID
FiT2nc06AtOiF3bjdmLO+pY=
=dgTh
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 and java 1.5 Annotations

Posted by Gianfranco Oldani <gf...@hotmail.com>.
Hello Subhash,
Thanks a lot it works. You have probably more experience than me with JUnit 
4 and maven. I would ask you another question. I have written my test class 
as described in the cookbook (for 4.0) by Kent Beck, Erich Gamma on the 
JUnit web site but I have still to prefix all my testing method by the 
"test" keyword. Its like if the annotations were ignored. An idea?

Regards

Gianfranco OLDANI
Mob: +41787330350
Web: www.gfoldani.com



----Original Message Follows----
From: "Subhash Chandran" <su...@gmail.com>
Reply-To: "Maven Users List" <us...@maven.apache.org>
To: "Maven Users List" <us...@maven.apache.org>
Subject: Re: Maven 2 and java 1.5 Annotations
Date: Mon, 20 Mar 2006 00:13:15 +0530

Your pom.xml:
<project ...>
...
<build>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
                     <source>1.5</source>
                     <target>1.5</target>
                 </configuration>
             </plugin>
...
...

And verify that in ur PATH environment variable u have JDK 1.5 bin folder.
Also if JAVA_HOME is specified, it also should point to JDK1.5 directory.

Regards,
Subhash.


On 3/20/06, Gianfranco Oldani <gf...@hotmail.com> wrote:
 >
 > Hi all,
 > I use maven 2 and it need to compile sources with annotations (JUnit 4.0
 > annotations) and I get always this message:
 >
 > notations are not supported in -source 1.3
 > (try -source 1.5 to enable annotations)
 >     @Before public void setUp()
 >
 > I use JDK 1.5.0_04.
 >
 > Somebody can help? Thanks for help
 >
 > Gianfranco OLDANI
 > Mob: +41787330350
 > Web: www.gfoldani.com
 >
 > _________________________________________________________________
 > Sélectionnez les meilleurs albums pour votre discothèque MP3 en ligne!
 > http://sib1.od2.com/common/Framework.aspx?shid=0045002E
 >
 >
 > ---------------------------------------------------------------------
 > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
 > For additional commands, e-mail: users-help@maven.apache.org
 >

_________________________________________________________________
Vous rêvez de chaussettes aux doigts de pieds séparés? Demandez à MSN 
Search! http://search.msn.ch/results.aspx?q=chaussettes+originales&FORM=QBRE


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven 2 and java 1.5 Annotations

Posted by Subhash Chandran <su...@gmail.com>.
Your pom.xml:
<project ...>
...
<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
...
...

And verify that in ur PATH environment variable u have JDK 1.5 bin folder.
Also if JAVA_HOME is specified, it also should point to JDK1.5 directory.

Regards,
Subhash.


On 3/20/06, Gianfranco Oldani <gf...@hotmail.com> wrote:
>
> Hi all,
> I use maven 2 and it need to compile sources with annotations (JUnit 4.0
> annotations) and I get always this message:
>
> notations are not supported in -source 1.3
> (try -source 1.5 to enable annotations)
>     @Before public void setUp()
>
> I use JDK 1.5.0_04.
>
> Somebody can help? Thanks for help
>
> Gianfranco OLDANI
> Mob: +41787330350
> Web: www.gfoldani.com
>
> _________________________________________________________________
> Sélectionnez les meilleurs albums pour votre discothèque MP3 en ligne!
> http://sib1.od2.com/common/Framework.aspx?shid=0045002E
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>