I am researching possibilities to create "project templates" for the kind of projects my team is working on (Embedded Java). We want to make it trivial for a new developer to not mess up creating a new project. All the tools we use in our team should be pr
The basic idea is that there should be one command to set up a project and IDE to provide for the following:
Create a new Java project including Eclipse project file.
Create a Build script (needs to work outside of the IDE).
Include deploy options in the build script.
Set up a git project.
Setup PMD to run with a configured set of rules integrated in the IDE.
Setup Checkstyle to run with a configured set of rules integrated in the IDE.
Configure code templates (Eclipse) to match our teams coding guidelines (Javadoc, ...)
Configure the Eclipse code Formatter.
The configuration of the command should be upgradeable easily.
So far I see two ways to do this:
Maven 2 Archetype: I basically do not like maven because I have been fighting with it so often. I am not sure that the overhead of trying to make the tool do what I want it to justifies the effort. On the other hand it seems like this is exactly what archetypes are supposed to do. Do you have any experience in how far you can customize the eclipse:eclipse part? I guess that the eclipse configuration with be the most complicated step.
Eclipse Nature: I could create a project nature. As far as I understand the Eclipse Ecosystem that is the component that would show up, if I would choose to provide for something like right click -> New -> My Java Project Type. Do you know how far I can customize the resulting Eclipse project?
Shell Script: I could create an empty project with all the configuration in place, introduce some special tokens in the relevant plain text files (like and then write a shellscript that reads values for these options from a properties file, copy the project template and substitute the values.). While it is maybe a bit fragile, it seems like a easy and quick way of doing it.
Do give you a little more context: It is ok, if the result locks us into Eclipse. While the build should run without Eclipse (for our CI), the Team uses eclipse and it is highly unlikely that we will ever switch. Also all developers run more or less the same Hard+Software (Linux). We don't work in the domain of Enterprise Java Apps so we really don't need all the fancy dependency management stuff from maven. As a matter of fact our build process is so special, that it probably is much easier to just call make or ant scripts.
So the Questions are:Do you have any experience with this kind of stuff?
Do you have an opinion towards either the Eclipse Nature way or Maven?
Do you know other tools that provide for a setup like that?
Thank you very much for your input.
Cheers,
Valentin
PS: People seem to be religious about their build tools. Please note that I do not want to start a flamewar here for or against maven. I am sure maven can be a great tool but I think in our context we only need 5% of its functionality and from my experience that remaining 95% can get in your way.
解决方案
You can also just create your own PDE tooling project and extend PDE project templates.
There is a great article at IBM DelevoperWorks network that gives a great introduction to Building templates with the Eclipse Plug-in Development Environment
You can also read up on Eclipse documentation about following PDE extension points:
org.eclipse.pde.ui.templates -- registers plug-in project content templates that are used to generate code for the new extensions
org.eclipse.pde.ui.newExtension -- contribute wizards that will be used to create and edit new extensions in PDE plug-in manifest editor
org.eclipse.pde.ui.pluginContent -- provides for contributing wizards that create additional content of the PDE plug-in projects