You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Adam Hardy <Ad...@nomadsoft.com> on 2006/05/23 19:09:57 UTC

RE: Surefire and UnsupportedClassVersionError - more info

I just moved my whole project over to my unix box and the same error
occurred, which rules out some environmental factors.  

-----Original Message-----
From: Adam Hardy [mailto:Adam.Hardy@nomadsoft.com] 
Sent: 23 May 2006 17:22
To: Maven Users List
Subject: RE: Surefire and UnsupportedClassVersionError

Same here. 

I think it must have something to do with surefire setting up its own
classloader - although it seems impossible that it would have problems
with the jdk - I only have 1.5 and none other.  

-----Original Message-----
From: Marco Mistroni [mailto:mmistroni@gmail.com] 
Sent: 23 May 2006 17:01
To: Maven Users List
Subject: Re: Surefire and UnsupportedClassVersionError

yes in my main project.
the project that users surefire is a 'child project' of the main project
btw, what's your JDK version?
i got 1.5.0_06.....

hth
 marco


On 5/23/06, Adam Hardy <Ad...@nomadsoft.com> wrote:
>
> Well, mvn has downloaded surefire-2.0-SNAPSHOT and
> maven-surefire-plugin-2.2-SNAPSHOT, but I still get the original
error.
>
> BTW Marco, you say it works for you - are you targeting jdk 1.5?
>
> Thanks
> Adam
>
> -----Original Message-----
> From: Marco Mistroni [mailto:mmistroni@gmail.com]
> Sent: 23 May 2006 15:22
> To: Maven Users List
> Subject: Re: Surefire and UnsupportedClassVersionError
>
> hi  Adam,
> could you try 2.2-SNAPSHOT for surefire and see if that fixes it?
>
> frankly i have no ideaon why is failing, but the 2.2-s is working fine
4
> me..
>
> hth
> marco
>
> On 5/23/06, Adam Hardy <Ad...@nomadsoft.com> wrote:
> >
> > I have just set up Maven 2.0.4 on a new machine with JDK-1.5.0_06
and
> I
> > am running 'mvn test' on a small pilot project with java 1.5 code. I
> > have source and target = 1.5 in my POM (see below).
> >
> > mvn falls over on surefire with a UnsupportedClassVersionError
> >
> > [INFO] Surefire report directory:
> > C:\Projects\cortex\back-end\target\surefire-reports
> > org.apache.maven.surefire.booter.SurefireExecutionException:
> > com/cortex/base/domain/card/CardFinderTest (Unsupported major.minor
> > version 49.0); nested except
> > is java.lang.UnsupportedClassVersionError:
> > com/cortex/base/domain/card/CardFinderTest (Unsupported major.minor
> > version 49.0)
> >
> >
> > After searching the list archives and googling on this, I still
cannot
> > find a solution.
> >
> > There was an announcement on the list 2006-05-14 that surefire 2.2
has
> > been released but specifying version 2.2 in my POM doesn't help and
I
> > cannot find it on the repositories. It seems there is only 2.0.
> Perhaps
> > 2.2 will help but I can't see how to get it.
> >
> > I saw another message on the list
> >
> >
>
http://marc.theaimsgroup.com/?l=turbine-maven-user&m=114831704529929&w=2
> >
> > where the exact same problem occurred but the original poster signed
> off
> > saying they would wipe the surefire directory and see if that helps.
> > However they did not report back. More significantly, I wiped my
> > surefire jars and cleaned the whole project and have source and
target
> > specified as 1.5 but to no avail.
> >
> > What could the problem be?
> >
> > Thanks
> > Adam
> >
> > <project xmlns="http://maven.apache.org/POM/4.0.0"
> >
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >
> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/maven-v4_0_0.xsd">
> >
> > <modelVersion>4.0.0</modelVersion>
> >
> > <groupId>com.foo.bar</groupId>
> >
> > <artifactId>foo</artifactId>
> >
> > <packaging>pom</packaging>
> >
> > <version>1.0-SNAPSHOT</version>
> >
> > <name>The whole of foo</name>
> >
> > <organization>
> >
> > <name>d</name>
> >
> > <url>http://www.foo.com</url>
> >
> > </organization>
> >
> >
> >
> > <repositories>
> >
> > <repository>
> >
> > <id>Maven snapshots</id>
> >
> > <url>http://snapshots.maven.codehaus.org/maven2</url>
> >
> > <snapshots>
> >
> > <enabled>true</enabled>
> >
> > </snapshots>
> >
> > <releases>
> >
> > <enabled>false</enabled>
> >
> > </releases>
> >
> > </repository>
> >
> > <repository>
> >
> > <releases>
> >
> > <enabled>true</enabled>
> >
> > </releases>
> >
> > <snapshots>
> >
> > <enabled>false</enabled>
> >
> > </snapshots>
> >
> > <id>central</id>
> >
> > <name>Maven Repository Switchboard</name>
> >
> > <layout>default</layout>
> >
> > <url>http://repo1.maven.org/maven2</url>
> >
> > </repository>
> >
> > </repositories>
> >
> > <pluginRepositories>
> >
> > <pluginRepository>
> >
> > <id>Maven Snapshots</id>
> >
> > <url>http://snapshots.maven.codehaus.org/maven2/</url>
> >
> > <snapshots>
> >
> > <enabled>true</enabled>
> >
> > </snapshots>
> >
> > <releases>
> >
> > <enabled>false</enabled>
> >
> > </releases>
> >
> > </pluginRepository>
> >
> > <pluginRepository>
> >
> > <releases>
> >
> > <enabled>true</enabled>
> >
> > </releases>
> >
> > <snapshots>
> >
> > <enabled>false</enabled>
> >
> > </snapshots>
> >
> > <id>central</id>
> >
> > <name>Maven Repository Switchboard</name>
> >
> > <layout>default</layout>
> >
> > <url>http://repo1.maven.org/maven2</url>
> >
> > </pluginRepository>
> >
> > </pluginRepositories>
> >
> >
> >
> > <modules>
> >
> > <module>back-end</module>
> >
> > <module>gui</module>
> >
> > <module>standalone</module>
> >
> > </modules>
> >
> >
> >
> > <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>
> >
> > <plugin>
> >
> > <groupId>org.apache.maven.plugins</groupId>
> >
> > <artifactId>maven-surefire-plugin</artifactId>
> >
> > <version>2.2</version>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <groupId>org.codehaus.mojo</groupId>
> >
> > <artifactId>cobertura-maven-plugin</artifactId>
> >
> > <executions>
> >
> > <execution>
> >
> > <goals>
> >
> > <goal>clean</goal>
> >
> > <goal>check</goal>
> >
> > </goals>
> >
> > </execution>
> >
> > </executions>
> >
> > </plugin>
> >
> > </plugins>
> >
> > </build>
> >
> > <reporting>
> >
> > <plugins>
> >
> > <plugin>
> >
> > <groupId>org.codehaus.mojo</groupId>
> >
> > <artifactId>taglist-maven-plugin</artifactId>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <groupId>org.apache.maven.plugins</groupId>
> >
> > <artifactId>maven-javadoc-plugin</artifactId>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <groupId>org.codehaus.mojo</groupId>
> >
> > <artifactId>jxr-maven-plugin</artifactId>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <!-- Code rules verification report -->
> >
> > <groupId>org.apache.maven.plugins</groupId>
> >
> > <artifactId>maven-pmd-plugin</artifactId>
> >
> > <configuration>
> >
> > <targetjdk>1.4</targetjdk>
> >
> > <!--
> >
> > <rulesets>
> >
> > <ruleset>/rulesets/basic.xml</ruleset>
> >
> > <ruleset>/rulesets/controversial.xml</ruleset>
> >
> > </rulesets>
> >
> > <format>xml</format>
> >
> > -->
> >
> > <linkXref>true</linkXref>
> >
> > <sourceEncoding>utf-8</sourceEncoding>
> >
> > <minimumTokens>100</minimumTokens>
> >
> > </configuration>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <groupId>org.apache.maven.plugins</groupId>
> >
> > <artifactId>
> >
> > maven-project-info-reports-plugin
> >
> > </artifactId>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <!-- if uses issue then requires scm setup -->
> >
> > <groupId>org.codehaus.mojo</groupId>
> >
> > <artifactId>changes-maven-plugin</artifactId>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <groupId>org.apache.maven.plugins</groupId>
> >
> > <artifactId>maven-checkstyle-plugin</artifactId>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <!-- created from the sandbox -->
> >
> > <groupId>org.codehaus.mojo</groupId>
> >
> > <artifactId>cobertura-maven-plugin</artifactId>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <!-- Similarity analysis report based upon the Simian tool -->
> >
> > <groupId>org.codehaus.mojo</groupId>
> >
> > <artifactId>simian-report-maven-plugin</artifactId>
> >
> > <version>1.0-SNAPSHOT</version>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <groupId>org.codehaus.mojo</groupId>
> >
> > <artifactId>jdepend-maven-plugin</artifactId>
> >
> > <version>2.0-beta-1-SNAPSHOT</version>
> >
> > </plugin>
> >
> > <plugin>
> >
> > <groupId>org.apache.maven.plugins</groupId>
> >
> > <artifactId>maven-surefire-report-plugin</artifactId>
> >
> > <version>2.2</version>
> >
> > </plugin>
> >
> > </plugins>
> >
> > </reporting>
> >
> > <dependencies>
> >
> > <dependency>
> >
> > <groupId>junit</groupId>
> >
> > <artifactId>junit</artifactId>
> >
> > <version>3.8.1</version>
> >
> > <scope>test</scope>
> >
> > </dependency>
> >
> > <dependency>
> >
> > <groupId>org.easymock</groupId>
> >
> > <artifactId>easymock</artifactId>
> >
> > <version>2.0</version>
> >
> > <scope>test</scope>
> >
> > </dependency>
> >
> > </dependencies>
> >
> > </project>
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> 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: Surefire and UnsupportedClassVersionError - more info

Posted by Marco Mistroni <mm...@gmail.com>.
Hello Adam,
 can you try this pom.xml (obviously you'd need to change it for your
modules)....
and btw, can you clear your m2 repository so that jars get downloaded from
scratch again?

<project>
   <modelVersion>4.0.0</modelVersion>
   <groupId>ExpenseControl</groupId>
   <version>1.0</version>
   <artifactId>project</artifactId>
   <packaging>pom</packaging>
   <name>project</name>
   <pluginRepositories>
      <pluginRepository>
         <id>apache.snapshots</id>
         <url>http://cvs.apache.org/maven-snapshot-repository</url>
      </pluginRepository>
   </pluginRepositories>
   <repositories>
      <repository>
           <id>apache.snapshots</id>
           <url>http://cvs.apache.org/maven-snapshot-repository</url>
         </repository>
   </repositories>
   <modules>
     <module>ejbs</module>
     <module>web</module>
      <module>ear</module>
     <!-- <module>site</module>-->
   </modules>
   <build>
      <pluginManagement>
         <plugins>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                 <source>1.5</source>
                 <target>1.5</target>
               </configuration>
            </plugin>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-site-plugin</artifactId>
               <configuration>
                  <unzipCommand>/usr/bin/unzip -o > err.txt</unzipCommand>
               </configuration>
            </plugin>

         </plugins>
      </pluginManagement>
   </build>

   <dependencyManagement>
      <dependencies>
        <dependency>
            <groupId>geronimo-spec</groupId>
            <artifactId>geronimo-spec-j2ee</artifactId>
            <version>1.4-rc4</version>
        <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>fop</groupId>
            <artifactId>fop</artifactId>
            <version>0.20.5rc2</version>
        </dependency>
        <dependency>
            <groupId>axis</groupId>
            <artifactId>axis-saaj</artifactId>
            <version>1.3</version>
      </dependency>
      <dependency>
            <groupId>axis</groupId>
            <artifactId>axis</artifactId>
            <version>1.3</version>
      </dependency>

      <dependency>
         <groupId>ExpenseControl</groupId>
         <artifactId>ejbs</artifactId>
     <version>1.0</version>
      </dependency>

     </dependencies>
   </dependencyManagement>
   <distributionManagement>
      <site>
         <id>site</id>
         <name>project website</name>
         <url>scp://local.company.com/websites/project.company.com/</url>
      </site>
   </distributionManagement>
</project>


hth
 marco