DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Configuring Spring Roo for Java 7

Configuring Spring Roo for Java 7

Gordon Dickens user avatar by
Gordon Dickens
·
Apr. 09, 12 · Java Zone · Interview
Like (0)
Save
Tweet
5.87K Views

Join the DZone community and get the full member experience.

Join For Free

When creating a Roo project with the “project” command, we have the option to specify the Java Version

$ roo
roo> project --topLevelPackage com.gordondickens.myproj --java 6 

If we choose Java 7 with Roo 1.2.1, the code will not compile with AspectJ included.

Steps to change to Java 7:

  • Change the Java version to 1.7
  • Set the AspectJ version to 1.7.0.M1 or higher
  • Set the Maven AspectJ Plugin to 1.4 or higher
  • If using Hypersonic, change the version to 2.2.8 or higher
  • Change the Hibernate version to 4.1.2 or higher
  • (optional) Change the Hibernate Entity Manager to 4.1.2 or higher
<properties>
  <aspectj.version>1.7.0.M1</aspectj.version>
  <java.version>1.7</java.version>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <roo.version>1.2.1.RELEASE</roo.version>
  <slf4j.version>1.6.4</slf4j.version>
  <spring.version>3.1.1.RELEASE</spring.version>
</properties>
...
<dependency>
  <groupId>org.hsqldb</groupId>
  <artifactId>hsqldb</artifactId>
  <version>2.2.8</version>
</dependency>
<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-core</artifactId>
  <version>4.1.2</version>
</dependency>
<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-entitymanager</artifactId>
  <version>4.1.2</version>
  <exclusions>
    <exclusion>
      <groupId>cglib</groupId>
      <artifactId>cglib</artifactId>
    </exclusion>
    <exclusion>
      <groupId>dom4j</groupId>
      <artifactId>dom4j</artifactId>
    </exclusion>
  </exclusions>
</dependency>
...
<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>aspectj-maven-plugin</artifactId>
  <version>1.4</version>
  <dependencies>
    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjrt</artifactId>
      <version>${aspectj.version}</version>
    </dependency>
    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjtools</artifactId>
      <version>${aspectj.version}</version>
    </dependency>
  </dependencies>
  <executions>
    <execution>
      <goals>
        <goal>compile</goal>
        <goal>test-compile</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <outxml>true</outxml>
    <aspectLibraries>
      <aspectLibrary>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
      </aspectLibrary>
    </aspectLibraries>
    <source>${java.version}</source>
    <target>${java.version}</target>
  </configuration>
</plugin>
...

 

 

Java (programming language) Spring Roo

Published at DZone with permission of Gordon Dickens, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Don't Underestimate Documentation
  • Counting Faster With Postgres
  • Choosing Between REST and GraphQL
  • How To Integrate Third-Party Login Systems in Your Web App Using OAuth 2.0

Comments

Java Partner Resources

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo