You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by lightbulb432 <ve...@hotmail.com> on 2007/05/02 17:29:05 UTC

Compiler settings in Maven

I'm using JDK 1.5 but for some reason Maven gives a compiler error saying
"use -source 5 or higher to enable annotations". How can I tell Maven which
compiler to use?

I don't know much about Maven so I don't know where to change the setting -
would it be a project-level setting, would it be a custom property, would it
be a plugin option?

Thanks.
-- 
View this message in context: http://www.nabble.com/Compiler-settings-in-Maven-tf3680951s177.html#a10287101
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Compiler settings in Maven

Posted by James Abley <ja...@gmail.com>.
-1. I wouldn't want the default to change. A lot of people still run
App servers that require Java4 and won't run on Java5. Once Java4 is
fully end-of-lifed, then I wouldn't complain if it was altered.

Auto-detection based on JAVA_HOME would be a more palatable solution.

Cheers,

James

On 03/05/07, Brendan Donovan <br...@al.com.au> wrote:
> Maybe the default setting for maven shoudl be moved from 1.3 (I think?)
> to 1.5 after all it is a development tool and I think at this stage most
> development is done under 1.5. It would just make it an easier
> experience for new users of maven and preclude them having to ask this
> question on the forum. Also surely when you specify your JAVA_HOME it
> could infer the version and make it the default for you installation.
>
> Just a thought
> BD
>
>
>
> ben short wrote:
> > Add this to the bottom of your pom.
> >
> > <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>
> >         </plugins>
> > </build>
> >
> > On 5/2/07, lightbulb432 <ve...@hotmail.com> wrote:
> >>
> >> I'm using JDK 1.5 but for some reason Maven gives a compiler error
> >> saying
> >> "use -source 5 or higher to enable annotations". How can I tell Maven
> >> which
> >> compiler to use?
> >>
> >> I don't know much about Maven so I don't know where to change the
> >> setting -
> >> would it be a project-level setting, would it be a custom property,
> >> would it
> >> be a plugin option?
> >>
> >> Thanks.
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Compiler-settings-in-Maven-tf3680951s177.html#a10287101
> >>
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: Compiler settings in Maven

Posted by Brendan Donovan <br...@al.com.au>.
Maybe the default setting for maven shoudl be moved from 1.3 (I think?) 
to 1.5 after all it is a development tool and I think at this stage most 
development is done under 1.5. It would just make it an easier 
experience for new users of maven and preclude them having to ask this 
question on the forum. Also surely when you specify your JAVA_HOME it 
could infer the version and make it the default for you installation.

Just a thought
BD



ben short wrote:
> Add this to the bottom of your pom.
>
> <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>
>         </plugins>
> </build>
>
> On 5/2/07, lightbulb432 <ve...@hotmail.com> wrote:
>>
>> I'm using JDK 1.5 but for some reason Maven gives a compiler error 
>> saying
>> "use -source 5 or higher to enable annotations". How can I tell Maven 
>> which
>> compiler to use?
>>
>> I don't know much about Maven so I don't know where to change the 
>> setting -
>> would it be a project-level setting, would it be a custom property, 
>> would it
>> be a plugin option?
>>
>> Thanks.
>> -- 
>> View this message in context: 
>> http://www.nabble.com/Compiler-settings-in-Maven-tf3680951s177.html#a10287101 
>>
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


Re: Compiler settings in Maven

Posted by ben short <be...@benshort.co.uk>.
Add this to the bottom of your pom.

<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>
         </plugins>
</build>

On 5/2/07, lightbulb432 <ve...@hotmail.com> wrote:
>
> I'm using JDK 1.5 but for some reason Maven gives a compiler error saying
> "use -source 5 or higher to enable annotations". How can I tell Maven which
> compiler to use?
>
> I don't know much about Maven so I don't know where to change the setting -
> would it be a project-level setting, would it be a custom property, would it
> be a plugin option?
>
> Thanks.
> --
> View this message in context: http://www.nabble.com/Compiler-settings-in-Maven-tf3680951s177.html#a10287101
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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