For my project, depending on the chosen profile, Maven will filter a file called jdbc.properties and replaces several properties with database specific values during the processing of resources (mvn process-resources).
Here are some properties that are being filtered:
jdbc.driverClassName=${jdbc.driverClassName}
jdbc.url=${jdbc.url}
jdbc.username=${jdbc.username}
jdbc.password=${jdbc.password}
hibernate.dialect=${hibernate.dialect}
In the olden pre-m2Eclipse days, I created my Eclipse project through Maven from the command line using e.g. mvn eclipse:eclipse -P postgresql. Then in Eclipse, I had to manually include a custom jdbc.properties file with build specific properties since Eclipse by itself can't do that type of filtering.It worked, however, as you can imagine, this can be quite tedious, especially during the early development stage where your project's dependencies may change frequently.
But now m2eclipse is able to handle resources filtering for me from within Eclipse, which is really nice. Additionally, I can manage my dependencies using m2eclipse, and what is even better, I can visualize them as well. This is especially a live-saver when I need to figure out certain transitive dependencies.
This came in quite handy when I converted my project over to logback and SLF4J and needed to figure out all the commons-logging dependencies.I am using m2eclipse for several weeks now, and I haven't come across any major drawbacks, yet. Granted, I haven't really dug deeply into m2eclipse's features as I primarily use only the subset discussed above, but if you use Eclipse and your project is built using Maven, please take another look at m2eclipse.
No comments:
Post a Comment