MAVEN快捷创建SSM工程

版权声明:如需转载,请写明出处 https://blog.csdn.net/weixin_43113679/article/details/89681978

maven大家肯定不陌生,现在日益发展的现在,开发不能再依赖于你需要什么库,再在网上下载,再给你的eclipse配置上,这样太繁琐,现在有了maven就可以自己不用主动下载需要的jar包了,可以在maven的pom.xml中自己配置上需要的jar包还有对应的版本,那eclipse就可以自己去下载,如果慢可以配置阿里镜像,就快很多

下载maven并配置在编译工具上相信网上有很多教程或者博客,大家都可以去参考,因为我现在用的是SSM,所以就给大家推荐个博客,在maven上配置SSM的教程
https://blog.csdn.net/qq_26869339/article/details/84033764
大家可以参考,自己实践没有问题
在这我说一下我看这个的问题:因为我知道pom.xmlmaven是核心,但是里面的一开始没搞明白,在这里给自己个长个记性
pom.xml因为刚开始接触,个人认为主要是由4部分组成,

  1. properties

  2. dependencies

  3. build

  4. parent(现在还没用到,先不解释)

第一种


 <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring.version>4.3.14.RELEASE</spring.version>
    <security.version>4.2.5.RELEASE</security.version>
    <slf4j.version>1.7.25</slf4j.version>
    <log4j.version>2.8.2</log4j.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

上面就是属性,以spring.version代表的是spring的版本,后面不是${spring.version},代表的就是这个,方便版本不会弄错
第二种

 <dependencies>
    <!--spring-->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>${spring.version}</version>
    </dependency>
 </dependencies>

dependencies是最外层,dependency是无数个里面的一个,以后如果缺什么jar包,就直接在dependencies里面写上一个dependency,可直接去MVNJAR直接去找就可以,有写好的

第三种

<build></build>

里面的是当你要把maven项目导出的时候,你想创建什么

猜你喜欢

转载自blog.csdn.net/weixin_43113679/article/details/89681978
今日推荐