I am starting on a spring roo Project and noticed that there are many files such as
AspectJ (.aj) files - I think these are important files since they contain lot of code. But not sure if we have roo installed do we still need to add these to version control. Or they can be generated everytime, I guess not. But would like to here from people who have done this.
log.roo - I guess this is very important file I will keep this since it can regenerate my project.
eclipse .classpath/.project files - I always keep them in version control just to keep setup available for me. But not sure what is th开发者_如何学Goe best practice since I always faced the classpath problems due to dev machine local paths.
Unit Test files - I will want to keep them in version control. I browsed this thread on ST But do share your thoughts on this.
target directory content - I am thinking may be keeping this as empty directory in version control can be good, but would like to get more thoughts on it.
Some of these files must be in version control and the rest can be, but don't have to. In general, it would make things easier to add everything to version control. Let me explain:
- *.aj files:
These don't need to be in version control because they can be regenerated by roo. However, I'd recommend putting them in so that someone working with STS can simply check out the project and start working without even requiring Spring Roo to be installed.
- log.roo
Again, not required, but probably a good idea so that you can recreate the project, or simply have a record of what has been done.
- eclipse .classpath/.project files
These are required if you are to use STS with your project. You cannot easily import your project into STS without them. Of course, Spring Roo can largely regenerate these files, but it requires running something on the command line before being able to use them in STS.
- Unit Test files
I think it is silly not to add these to version control for all the reasons specified in the linked question.
- target directory content
Out of everything here, this is the only directory I'd recommend leaving out. The target directory contains build artifacts, not project artifacts.
I agreed with Andrew except the following exceptions.
You should add all the content of the /src folder. Although it contains Spring Roo generated artifacts but these artifacts are project sources and your can't build project without them using CI tools.
You definitely should add pom.xml to the version control. I consider this Maven's POM as one of the most important artifacts generated by the Spring Roo. Using POM you can configure your IDE projects settings among other Maven tasks (building and reporting for example).
So if you have these two parts (/src and pom.xml) you have buildable project which can be used with any Java IDE easily by any team member.
And I don't agree with Andrew that you should store .classpath/.project files. They are strongly IDE related and useless for IntelliJ IDEA or NetBeans users. It is better to generate these files after checking out sources using Spring Roo's
perform eclipse
or Maven's
mvn eclipse:eclipse
They are equivalent.
And of course you shouldn't add any /target or /bin folders.
So just add /src, pom.xml and log.roo. It is enought.
精彩评论