我开始使用Apache buildr。 据我所知,我总是要自己创建默认的文件夹结构(src / main / java等)? 有没有办法让buildr为我这份工作?
谢谢,
答案 0 :(得分:3)
答案 1 :(得分: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
希望这有帮助。