Writing programs in Java is cool, its a language thats very powerful which have right amount of flexibility that makes a developers life a hell easy. But when it comes to compiling, building and managing releases of a project its not that easy, it also has the same issues encountered by other programming languages.
To solve this problem, build tools like Apache ANT and Apache Maven have emerged. ANT is very flexible tool which allows users to do almost any thing when it comes to build, maintenance and releases. Having said that since its so flexible its quite hard to configure and manage, every project using ANT uses it in their own way and hence the projects using ANT looses their consistency. At the same time when we look at Apache Maven which is not flexible as ANT by default, but it follows an amazing concept "Convention over configuration" which give that right mix of convention and configuration for you to easily create, build, deploy and even manage releases at an enterprise level.
For examples Maven always works with defaults, and you can easily create and build a maven project just with the follow snippet in the pom.xml file of your project.
<project> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>sample-one</artifactId> <version>1.0.0</version> </project>
And this little configuration is tied up with many conventions
- The Java source code is available at {base-dir}/src/main/java
- Test cases are available at {base-dir}/src/test/java
- A JAR file type of artifact is produced
- Compiled class files are copied into {base-dir}/target/classes
- The final artifact is copied into {base-dir}/target
But there are cases where we need to go a step ahead and break the rules with reasons ! And in any case if we need to change the above defaults its just a matter of adding the Maven Build Plugin and the artifact type to the project tag as below.
<project> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>sample-one</artifactId> <version>1.0.0</version> <packaging>jar</packaging> <build> <sourceDirectory>${basedir}/src/main/java</sourceDirectory> <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory> <outputDirectory>${basedir}/target/classes</outputDirectory> </build> </project>
I came across this great book "Mastering Apache Maven 3" by Prabath Siriwardena that give you all the bits and pieces from getting started to eventually becoming a master in Maven. From this you will get to know the fundamentals and when to break the conventions with reasons. This helps you to develop and manage large, complex projects with confidence by providing an enterprise level knowledge to manage the whole Maven infrastructure.
This book covers Maven Configuration from the basics, discussing how to construct and build a Maven project, manage Build Lifecycles, introduce useful functionalities through Maven Plugins and helps you to write your own custom plugins when needed. It also provide steps on building distributable archives using Maven Assemblies which adheres to a user-defined layout and structure, demonstrate the usage of Maven Archetypes for easily construct Maven projects and steps to create new Archetypes to help your developers and customers to quickly start on your project type without any configurations and replicated work. Further it also helps you to host and manage your Maven artifacts in repositories using Maven Repository Management, and most importantly explains you the Best Practices to keep your projects in line with enterprise standards.
Thank you so much for information the free price quotes to find best post article list now # www.fooglepackers.com
ReplyDeletepackers and movers in bangalore
packers and movers in delhi
packers and movers in gurgaon
packers and movers in pune
packers and movers in mumbai
packers and movers in hyderabad
packers and movers in chennai
When you're tired, you want to relax after a stressful working hours, you need to have time to take care of the kids active.
ReplyDeletePlease visit our website and play exciting flash games.
Thanks you for sharing!
Moto X3M
kizi games
I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
ReplyDeletemutilateadoll23.com
luffygames.com