2012-04-28 61 views
0

我开始使用Apache buildr。 据我了解,我总是必须自己创建默认的文件夹结构(src/main/java等)? 有没有办法让建筑师为我做这份工作?buildr生成文件夹结构

感谢,

回答

3
  • 使用Maven 2原型代
  • 运行Buildr从项目目录。它会看到pom.xml,并询问您是否想要 从中创建基本的Buildr脚本。
  • 运行“buildr蚀”产生的.classpath和.project
  • 在Eclipse中,进口从现有的项目中的文件系统
0

buildr只是一个构建工具,它并不意味着产生原型或建立一个网站。

但是你是对的,有时你需要生成一个新的项目,所以我写了一个很小的shell脚本(you can find the gist here)。

这里是它如何工作的:

$ ./createBuildrProject.sh jptest 
Please answer '1' to the next question 
To use Buildr you need a buildfile. Do you want me to create one?: 
1. From directory structure 
2. Cancel 
? 1 
Created /home/jp/src/perso/774597/jptest/buildfile 
(in /home/jp/src/perso/774597/jptest, development) 
Building jptest 
Compiling jptest into /home/jp/src/perso/774597/jptest/target/classes 
Compiling jptest:test into /home/jp/src/perso/774597/jptest/target/test/classes 
Completed in 2.130s 
./createBuildrProject.sh: ligne 17 : cd: jptest: Aucun fichier ou dossier de ce type 
(in /home/jp/src/perso/774597/jptest, development) 
Generating Eclipse project for jptest 
Writing /home/jp/src/perso/774597/jptest/.classpath 
Writing /home/jp/src/perso/774597/jptest/.project 
Completed in 0.025s 

输出目录是这样的:

$ tree jptest/ 
jptest/ 
├── buildfile 
├── reports 
│   └── junit 
│    └── last_successful_run 
├── src 
│   ├── main 
│   │   └── java 
│   │    └── Empty.java 
│   └── test 
│    └── java 
│     └── EmptyTest.java 
└── target 
    ├── classes 
    │   └── Empty.class 
    ├── jptest-1.0.0.pom 
    └── test 
     └── classes 
      └── EmptyTest.class 

11 directories, 7 files 

希望这有助于。