Tuesday, August 21, 2012

Configuration Maven and JBOSS


Configuration Maven and JBOSS


Configure Maven
Step1:
Open Environment Variables

Step2:
Create New System Variables
Maven Home parameter: M2_HOME
Value "maven root directory"

Step3:
Enter the below value in path ;%M2_HOME%\bin;

Step4:
Apply and ok

Verification:
Open maven bin directory and type command
mvn -version

Configure JBOSS 7.1

step1: download JDK1.6 or above

step2: install JDK

step3: create JAVA_HOME

step3.1 :
Open Environment Variables

Step3.2:
Create New System Variables
JAVA Home parameter: JAVA_HOME
Value "Java root directory"

Step3.3:
Enter the below value in path ;%JAVA_HOME%\bin;

Step3.4:
Apply and ok

After installing Java and Maven download JBOSS 7.1 and unzip and run the command standalone.bat from bin directory.

Now all set to use JBOSS.

http://www.youtube.com/watch?v=zkNyEXArwwI

http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/guide/GettingStarted/#_installing_and_starting_the_jboss_server_on_windows


Tuesday, August 7, 2012

Maven vs Ant


Maven vs Ant.

This article provides difference between two tools and why in one case you choose Ant and in another Maven. It help to make a choice between two Java build tools.

developers usually prefer one tool over another because:

1. Develop faster
2. Concentrate on real work
3. Generate all related document easy

developer also prefer one tool over another to keep our bosses happy, which means:

1. Reduce development costs
2. Reduce time to market
3. Frequent status reports, which can be easily presented to higher boss

Ant is older tool and it was deigned to have some Java-based build tool. Something similar to Make which most of C++ developers use.

Ant is different. Instead of a model where it is extended with shell-based commands, Ant is extended using Java classes. Instead of writing shell commands, the configuration files are XML-based, The power of Ant in practice results that you have to setup build process yourself. Each project can have different build process. New team members have to study this version of build which is probably they used to have in another project.

Maven (Maven)on another hand wants a standard way to build the projects, a clear definition of what the project consisted of, an easy way to publish project information and a way to share JARs across several projects.

Maven encourage best practices and some people can prefer Ant. Ant is less flexible than Maven and you have to be agree with making of some compromises.

Maven is not the next generation Ant!
Maven is not just a building tool, it provide an organization and a structure layer. All you do in ant can be done in Maven because you can call ant target.

The main advantage to migrate to Maven are : standardization of how to handle a project, dependencies are clearly defined, the concept of artifacts that can be shared to other projects, documentation and reports, remote and local repository concepts.

Maven will help you with:

1. Making the build process easy and provide uniform build environment
2. Generate quality project information

Major advantages/disadvantages - Maven vs Ant.

Maven
1. Description of project Development of a build script per project
2. Invocation of defined goals (targets) Invocation of project specific targets
3. Project knowledge "Just" the build process
4. build life cycle, standard project layout too complex scripts
5. reusable plugins, repositories scripts are not reusable
6. moving fast forward development are slowed down
7. Maven is declarative, Â Maven takes care of all the directories once the files are stored in the pom.xml file.
8. Maven has a life cycle.

Ant
1. Development of a build script per project
2. Invocation of project specific targets
3. "Just" the build process
4. too complex scripts
5. scripts are not reusable
6. development are slowed down
7. Ant is procedural. In Ants, you have to specifically order what should have to be done.
8. Ant does not have a life cycle.

The good thing with Maven that it is extremely flexible, because it consists of core and numerous plugins that are accessible in online repositories. Relations between different projects and subprojects are based on a single source of information POM (xml) file - Project object Model. One POM points to another POMs which can have flat or hierarchical structure.

A project produces an artifact - jar, ear, war...

Maven features:

1. Dependencies are downloaded automatically
2. Standardized, very consistent layout
3. Standardized, very consistent naming
4. Code coverage
5. Extensive reports
6. Maven easily works with JUnit tests


http://www.javafaq.nu/java-article1168.html

http://www.scribd.com/doc/19172721/A-Brief-Comparison-of-ANT-MAVEN

Spring Framwork Tutorial