Skip to content

1step Java Infrastructure

dreamhead edited this page Sep 22, 2012 · 5 revisions

This is the description about what the project generated by 1step looks like.

Java

Source Code Layout

  src
  |__main
  |  |__java           <-- Source files to compile
  |  |__resources      <-- Resources to copy
  |  |__webapp         <-- For WARs
  |__test
  |  |__java           <-- Source files to compile (tests)
  |  |__resources      <-- Resources to copy (tests)
  |__target            <-- Packages created here
  |  |__classes        <-- Generated when compiling
  |  |__resources      <-- Copied (and filtered) from resources
  |  |__test/classes   <-- Generated when compiling tests
  |  |__test/resources <-- Copied (and filtered) from resources
  |__reports           <-- Test, coverage and other reports

Build Script

Currently, only buildr is supported.

Basic Project Support

You can compile by

  buildr compile

package by

  buildr package

test by

  buildr test

Static Analysis

Checkstyle and cobertura have been supported in current project. Both of them have been set to run as default task.

Checkstyle

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard.

  buildr [your_project_name]:checkstyle

You can customize your your own check by adjust rule in

  [your_project_root]/config/checkstyle/checkstyle.xml

Cobertura

Cobertura is a free Java tool that calculates the percentage of code accessed by tests.

When you run test, cobertura will run automatically.

You can change cobertura configuration in buildfile. But you'd better keep your branch_rate and line_rate as 100, so god will bless you.

cobertura.check.branch_rate = 100
cobertura.check.line_rate = 100

IDE Integration

You can get IntelliJ IDEA project by

  buildr idea

and eclipse project by

  buildr eclipse 

WAR

Jetty as WAR container

You can run Jetty as WAR container to run your web application by

  buildr [your_project_name]:jetty

MVC Support

  • Spring MVC, the default MVC framework

View Support

ORM

Spring Data JPA, the default ORM framework