Question
I'm starting to use Apache buildr. As far as I understand, I always have to create the default folder structure (src/main/java etc) on my own? Is there a way to let buildr to this job for me?
Thanks,
Solution
- Use Maven 2 archetype generation
- Run Buildr from the project dir. it sees the pom.xml and asks if you want to create a basic Buildr script from it.
- Run 'buildr eclipse' to generate .classpath and .project
- In Eclipse, import from a existing project in file system
OTHER TIPS
buildr is just a build tool, it is not meant to generate archetypes or build a website.
But you're right, sometimes you need to generate a new project, so I wrote a tiny shell script (you can find the gist here).
Here is how it works :
$ ./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
The output directories are like this :
$ 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
Hope this helps.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow