You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stefan Armbruster <ml...@armbruster-it.de> on 2009/03/21 20:43:33 UTC

Checking the java class version in maven artifacts

Hi,

is there a maven plugin that provides a in-depth check of the java class 
version in a generated artifact, e.g. a war file? 
Assume a deployment environment using jdk 1.4. Developers work on java 6. The 
deployment should fail, if any java class has a class version >48 (48 is the 
version for 1.4). For java code inside the projects that's easy by setting 
source and target to 1.4 in maven-compiler-plugin. But how to make sure that 
no dependency jar contains any class file >48?

It would be rather easy to implement a mojo for this job. I wonder if this 
feature already exists somewhere - I don't want to reinvent the wheel twice.

Regards,
Stefan

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


Re: Checking the java class version in maven artifacts

Posted by Ringo De Smet <ri...@gmail.com>.
Brett,

2009/3/21 Brett Randall <ja...@gmail.com>:
> I think this was asked on the list last week, or recently anyway.  The
> poster was pointed at https://animal-sniffer.dev.java.net/ .

You are right! I requested this last week. However, the Maven plugin
of animal-sniffer didn't really have a mojo for only checking the
class file versions although most of the ground work was there. I sent
Koshuke a patch for including another goal to check the main and
attached artifacts for a specific Java version. It seems it can help
out some other people too, so here is the patch file again.

Ringo

Re: Checking the java class version in maven artifacts

Posted by Brett Randall <ja...@gmail.com>.
I think this was asked on the list last week, or recently anyway.  The
poster was pointed at https://animal-sniffer.dev.java.net/ .

Brett

On Sun, Mar 22, 2009 at 6:43 AM, Stefan Armbruster
<ml...@armbruster-it.de>wrote:

> Hi,
>
> is there a maven plugin that provides a in-depth check of the java class
> version in a generated artifact, e.g. a war file?
> Assume a deployment environment using jdk 1.4. Developers work on java 6.
> The
> deployment should fail, if any java class has a class version >48 (48 is
> the
> version for 1.4). For java code inside the projects that's easy by setting
> source and target to 1.4 in maven-compiler-plugin. But how to make sure
> that
> no dependency jar contains any class file >48?
>
> It would be rather easy to implement a mojo for this job. I wonder if this
> feature already exists somewhere - I don't want to reinvent the wheel
> twice.
>
> Regards,
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Checking the java class version in maven artifacts

Posted by Tamás Cservenák <ta...@cservenak.net>.
This smells for me like some new rule for enforcer...

~t~

On Sun, Mar 22, 2009 at 12:20 AM, Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> google is your friend "animal sniffer Kohsuke"
>
> Sent from my [rhymes with myPod] ;-)
>
>
> On 21 Mar 2009, at 19:43, Stefan Armbruster <ml...@armbruster-it.de>
> wrote:
>
>  Hi,
>>
>> is there a maven plugin that provides a in-depth check of the java class
>> version in a generated artifact, e.g. a war file?
>> Assume a deployment environment using jdk 1.4. Developers work on java 6.
>> The
>> deployment should fail, if any java class has a class version >48 (48 is
>> the
>> version for 1.4). For java code inside the projects that's easy by setting
>> source and target to 1.4 in maven-compiler-plugin. But how to make sure
>> that
>> no dependency jar contains any class file >48?
>>
>> It would be rather easy to implement a mojo for this job. I wonder if this
>> feature already exists somewhere - I don't want to reinvent the wheel
>> twice.
>>
>> Regards,
>> Stefan
>>
>> ---------------------------------------------------------------------
>> 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: Checking the java class version in maven artifacts

Posted by Stephen Connolly <st...@gmail.com>.
google is your friend "animal sniffer Kohsuke"

Sent from my [rhymes with myPod] ;-)

On 21 Mar 2009, at 19:43, Stefan Armbruster <ml...@armbruster-it.de>  
wrote:

> Hi,
>
> is there a maven plugin that provides a in-depth check of the java  
> class
> version in a generated artifact, e.g. a war file?
> Assume a deployment environment using jdk 1.4. Developers work on  
> java 6. The
> deployment should fail, if any java class has a class version >48  
> (48 is the
> version for 1.4). For java code inside the projects that's easy by  
> setting
> source and target to 1.4 in maven-compiler-plugin. But how to make  
> sure that
> no dependency jar contains any class file >48?
>
> It would be rather easy to implement a mojo for this job. I wonder  
> if this
> feature already exists somewhere - I don't want to reinvent the  
> wheel twice.
>
> Regards,
> Stefan
>
> ---------------------------------------------------------------------
> 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