Starting from scratch, do it with Me Jblog Project (ii) Maven

Source: Internet
Author: User

From scratch, do it with me. Jblog Project (a) Introduction

Starting from scratch, do it with Me Jblog Project (ii) Maven

MAVEN is a project management tool, especially for the Java world

Prior to the development of Jblog, there was no system to use Maven

Just used Subclipse and SVN versioning during a co-development process and learned some of MAVEN's knowledge

After serious learned the "Maven combat" ebook, I think maven is what every Java programmer needs to know and use.

Why? Because in the Java world, you can't write everything yourself.

There are too many jar packages to be introduced, and there are too many versions of these jar packages to get out of control.

In this out-of-control jar world, reliance on conflict, repetitive dependence, and dependency bloat are inevitably taking place

Without Maven, you can only need to download the jar package when you go to their official website, and you'll have to download the latest version in ten to ten, and you'll never be able to use it.

MAVEN coordinates all the world's jar packs, and each version gives you coordinates.

You can use a few lines of XML tags to get maven to help you accurately download the specified version of the jar package from the central repository

and the dependency jar package on some columns of this jar package, it all helps you to fix it, and you will definitely thank it for

This is the biggest benefit of using MAVEN, plus maven will help you optimize your code structure, build a test framework, and implement some very useful features like packaging management.

For the specific use of MAVEN, recommended download "Maven combat" this ebook, the system to look at the book's first six chapters, not more than 100 pages of PDF

Believe you can quickly master Maven's basic configuration and usage

Jblog Project planning early, only integrated hibernate framework, the following is the integrated Hibernate pom.xml file, as development progresses, POM files will be gradually plump

<Projectxmlns= "http://maven.apache.org/POM/4.0.0"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">    <modelversion>4.0.0</modelversion>    <groupId>Com.newflypig.jblog</groupId>    <Artifactid>Jblog</Artifactid>    <Packaging>War</Packaging>    <version>0.0.1-snapshot</version>    <name>Jblog Maven Webapp</name>    <URL>http://maven.apache.org</URL>        <repositories>        <Repository>            <ID>JBoss Repository</ID>            <URL>http://repository.jboss.org/nexus/content/groups/public/</URL>        </Repository>        <Repository>            <ID>Maven</ID>            <name>Maven Repository</name>            <URL>http://repo2.maven.org/maven2/</URL>        </Repository>    </repositories>        <Properties>        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>        <spring.version>4.1.4.RELEASE</spring.version>        <hibernate.version>4.3.9.Final</hibernate.version>    </Properties>            <Dependencies>        <Dependency>          <groupId>Org.hibernate</groupId>          <Artifactid>Hibernate-core</Artifactid>          <version>${hibernate.version}</version>        </Dependency>        <Dependency>            <groupId>Org.hibernate</groupId>            <Artifactid>Hibernate-ehcache</Artifactid>            <version>${hibernate.version}</version>        </Dependency>        <!--level Two cache Ehcache -        <Dependency>            <groupId>Net.sf.ehcache</groupId>            <Artifactid>Ehcache</Artifactid>            <version>2.9.0</version>        </Dependency>        <!--log4j -        <Dependency>            <groupId>Log4j</groupId>            <Artifactid>Log4j</Artifactid>            <version>1.2.17</version>        </Dependency>        <!--MySQL Connection -        <Dependency>            <groupId>Mysql</groupId>            <Artifactid>Mysql-connector-java</Artifactid>            <version>5.1.37</version>        </Dependency>        <!--JSON -        <Dependency>            <groupId>Com.alibaba</groupId>            <Artifactid>Fastjson</Artifactid>            <version>1.2.7</version>        </Dependency>                <Dependency>            <groupId>Junit</groupId>            <Artifactid>Junit</Artifactid>            <version>4.7</version>            <Scope>Test</Scope>        </Dependency>        <Dependency>            <groupId>Javax.servlet</groupId>            <Artifactid>Javax.servlet-api</Artifactid>            <version>4.0.0-b01</version>            <Scope>Provided</Scope>        </Dependency>    </Dependencies>    <Build>        <Finalname>Jblog</Finalname>    </Build></Project>

Starting from scratch, do it with Me Jblog Project (ii) Maven

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.