zoukankan      html  css  js  c++  java
  • Eclipse搭建Maven项目并上传SVN备份

    本文出自:http://www.cnblogs.com/2186009311CFF/p/7226127.html

    背景:近段时间在学着Java,想着用Java做BS的项目。但是项目一遇到问题又要重做,故想起了用SVN做备份。

    硬件条件:电脑是windows的64位系统。

    一、建项目的总体思路是:

    前期:

    a.安装JDK,配置JAVA环境变量(Eclipse基于JAVA环境,所以必须安装JDK)

      从Oracle官网下载适合系统的JDK:http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html#javasejdk

      安装并配置Java环境变量

      若安装成功,打开命令提示符,输入“java -version”,类似如图所示,则说明安装成功

    b.workspace:UTF-8

      选择Windows下的Preferences,如图:

      出现下图,输入workspace,选择workspace,把GBK改为UTF-8,选择Apply,OK,具体如下图:

    c.安装配置meven +本地仓库

      去maven官网下载maven:

      配置maven环境变量

      Eclipse配置maven:

      Eclipse配置本地仓库前,请确认本地仓库的setting.xml内容的下面位置是您本地仓库实际所在位置:(若无setting.xml文件则在maven的解压文件中拷贝一份到本地仓库文件下,改成实际本地仓库的位置,再在Eclipse里配置)

      本地仓库就是所有jar包的集合。

      Eclipse配置本地仓库如下:

    搭建Maven项目步骤:

    1.project
    parent
    pom
    pom管理版本号

    pom文件如下所示:

    用以下文件此模块的pom.xml文件:

      1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      2     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      3     <modelVersion>4.0.0</modelVersion>
      4     <groupId>cn.e3mall</groupId>
      5     <artifactId>e3-parent</artifactId>
      6     <version>0.0.1-SNAPSHOT</version>
      7     <packaging>pom</packaging>
      8     <!-- 集中定义依赖版本号 -->
      9     <properties>
     10         <junit.version>4.12</junit.version>
     11         <spring.version>4.2.4.RELEASE</spring.version>
     12         <mybatis.version>3.2.8</mybatis.version>
     13         <mybatis.spring.version>1.2.2</mybatis.spring.version>
     14         <mybatis.paginator.version>1.2.15</mybatis.paginator.version>
     15         <mysql.version>5.1.32</mysql.version>
     16         <slf4j.version>1.6.4</slf4j.version>
     17         <jackson.version>2.4.2</jackson.version>
     18         <druid.version>1.0.9</druid.version>
     19         <httpclient.version>4.3.5</httpclient.version>
     20         <jstl.version>1.2</jstl.version>
     21         <servlet-api.version>2.5</servlet-api.version>
     22         <jsp-api.version>2.0</jsp-api.version>
     23         <joda-time.version>2.5</joda-time.version>
     24         <commons-lang3.version>3.3.2</commons-lang3.version>
     25         <commons-io.version>1.3.2</commons-io.version>
     26         <commons-net.version>3.3</commons-net.version>
     27         <pagehelper.version>3.4.2-fix</pagehelper.version>
     28         <jsqlparser.version>0.9.1</jsqlparser.version>
     29         <commons-fileupload.version>1.3.1</commons-fileupload.version>
     30         <jedis.version>2.7.2</jedis.version>
     31         <solrj.version>4.10.3</solrj.version>
     32         <dubbo.version>2.5.3</dubbo.version>
     33         <zookeeper.version>3.4.7</zookeeper.version>
     34         <zkclient.version>0.1</zkclient.version>
     35         <activemq.version>5.11.2</activemq.version>
     36         <freemarker.version>2.3.23</freemarker.version>
     37         <quartz.version>2.2.2</quartz.version>
     38     </properties>
     39     <dependencyManagement>
     40         <dependencies>
     41             <!-- 时间操作组件 -->
     42             <dependency>
     43                 <groupId>joda-time</groupId>
     44                 <artifactId>joda-time</artifactId>
     45                 <version>${joda-time.version}</version>
     46             </dependency>
     47             <!-- Apache工具组件 -->
     48             <dependency>
     49                 <groupId>org.apache.commons</groupId>
     50                 <artifactId>commons-lang3</artifactId>
     51                 <version>${commons-lang3.version}</version>
     52             </dependency>
     53             <dependency>
     54                 <groupId>org.apache.commons</groupId>
     55                 <artifactId>commons-io</artifactId>
     56                 <version>${commons-io.version}</version>
     57             </dependency>
     58             <dependency>
     59                 <groupId>commons-net</groupId>
     60                 <artifactId>commons-net</artifactId>
     61                 <version>${commons-net.version}</version>
     62             </dependency>
     63             <!-- Jackson Json处理工具包 -->
     64             <dependency>
     65                 <groupId>com.fasterxml.jackson.core</groupId>
     66                 <artifactId>jackson-databind</artifactId>
     67                 <version>${jackson.version}</version>
     68             </dependency>
     69             <!-- httpclient -->
     70             <dependency>
     71                 <groupId>org.apache.httpcomponents</groupId>
     72                 <artifactId>httpclient</artifactId>
     73                 <version>${httpclient.version}</version>
     74             </dependency>
     75             <!-- quartz任务调度框架 -->
     76             <dependency>
     77                 <groupId>org.quartz-scheduler</groupId>
     78                 <artifactId>quartz</artifactId>
     79                 <version>${quartz.version}</version>
     80             </dependency>
     81             <!-- 单元测试 -->
     82             <dependency>
     83                 <groupId>junit</groupId>
     84                 <artifactId>junit</artifactId>
     85                 <version>${junit.version}</version>
     86                 <scope>test</scope>
     87             </dependency>
     88             <!-- 日志处理 -->
     89             <dependency>
     90                 <groupId>org.slf4j</groupId>
     91                 <artifactId>slf4j-log4j12</artifactId>
     92                 <version>${slf4j.version}</version>
     93             </dependency>
     94             <!-- Mybatis -->
     95             <dependency>
     96                 <groupId>org.mybatis</groupId>
     97                 <artifactId>mybatis</artifactId>
     98                 <version>${mybatis.version}</version>
     99             </dependency>
    100             <dependency>
    101                 <groupId>org.mybatis</groupId>
    102                 <artifactId>mybatis-spring</artifactId>
    103                 <version>${mybatis.spring.version}</version>
    104             </dependency>
    105             <dependency>
    106                 <groupId>com.github.miemiedev</groupId>
    107                 <artifactId>mybatis-paginator</artifactId>
    108                 <version>${mybatis.paginator.version}</version>
    109             </dependency>
    110             <dependency>
    111                 <groupId>com.github.pagehelper</groupId>
    112                 <artifactId>pagehelper</artifactId>
    113                 <version>${pagehelper.version}</version>
    114             </dependency>
    115             <!-- MySql -->
    116             <dependency>
    117                 <groupId>mysql</groupId>
    118                 <artifactId>mysql-connector-java</artifactId>
    119                 <version>${mysql.version}</version>
    120             </dependency>
    121             <!-- 连接池 -->
    122             <dependency>
    123                 <groupId>com.alibaba</groupId>
    124                 <artifactId>druid</artifactId>
    125                 <version>${druid.version}</version>
    126             </dependency>
    127             <!-- Spring -->
    128             <dependency>
    129                 <groupId>org.springframework</groupId>
    130                 <artifactId>spring-context</artifactId>
    131                 <version>${spring.version}</version>
    132             </dependency>
    133             <dependency>
    134                 <groupId>org.springframework</groupId>
    135                 <artifactId>spring-beans</artifactId>
    136                 <version>${spring.version}</version>
    137             </dependency>
    138             <dependency>
    139                 <groupId>org.springframework</groupId>
    140                 <artifactId>spring-webmvc</artifactId>
    141                 <version>${spring.version}</version>
    142             </dependency>
    143             <dependency>
    144                 <groupId>org.springframework</groupId>
    145                 <artifactId>spring-jdbc</artifactId>
    146                 <version>${spring.version}</version>
    147             </dependency>
    148             <dependency>
    149                 <groupId>org.springframework</groupId>
    150                 <artifactId>spring-aspects</artifactId>
    151                 <version>${spring.version}</version>
    152             </dependency>
    153             <dependency>
    154                 <groupId>org.springframework</groupId>
    155                 <artifactId>spring-jms</artifactId>
    156                 <version>${spring.version}</version>
    157             </dependency>
    158             <dependency>
    159                 <groupId>org.springframework</groupId>
    160                 <artifactId>spring-context-support</artifactId>
    161                 <version>${spring.version}</version>
    162             </dependency>
    163             <!-- JSP相关 -->
    164             <dependency>
    165                 <groupId>jstl</groupId>
    166                 <artifactId>jstl</artifactId>
    167                 <version>${jstl.version}</version>
    168             </dependency>
    169             <dependency>
    170                 <groupId>javax.servlet</groupId>
    171                 <artifactId>servlet-api</artifactId>
    172                 <version>${servlet-api.version}</version>
    173                 <scope>provided</scope>
    174             </dependency>
    175             <dependency>
    176                 <groupId>javax.servlet</groupId>
    177                 <artifactId>jsp-api</artifactId>
    178                 <version>${jsp-api.version}</version>
    179                 <scope>provided</scope>
    180             </dependency>
    181             <!-- 文件上传组件 -->
    182             <dependency>
    183                 <groupId>commons-fileupload</groupId>
    184                 <artifactId>commons-fileupload</artifactId>
    185                 <version>${commons-fileupload.version}</version>
    186             </dependency>
    187             <!-- Redis客户端 -->
    188             <dependency>
    189                 <groupId>redis.clients</groupId>
    190                 <artifactId>jedis</artifactId>
    191                 <version>${jedis.version}</version>
    192             </dependency>
    193             <!-- solr客户端 -->
    194             <dependency>
    195                 <groupId>org.apache.solr</groupId>
    196                 <artifactId>solr-solrj</artifactId>
    197                 <version>${solrj.version}</version>
    198             </dependency>
    199             <!-- dubbo相关 -->
    200             <dependency>
    201                 <groupId>com.alibaba</groupId>
    202                 <artifactId>dubbo</artifactId>
    203                 <version>${dubbo.version}</version>
    204             </dependency>
    205             <dependency>
    206                 <groupId>org.apache.zookeeper</groupId>
    207                 <artifactId>zookeeper</artifactId>
    208                 <version>${zookeeper.version}</version>
    209             </dependency>
    210             <dependency>
    211                 <groupId>com.github.sgroschupf</groupId>
    212                 <artifactId>zkclient</artifactId>
    213                 <version>${zkclient.version}</version>
    214             </dependency>
    215             <dependency>
    216                 <groupId>org.apache.activemq</groupId>
    217                 <artifactId>activemq-all</artifactId>
    218                 <version>${activemq.version}</version>
    219             </dependency>
    220             <dependency>
    221                 <groupId>org.freemarker</groupId>
    222                 <artifactId>freemarker</artifactId>
    223                 <version>${freemarker.version}</version>
    224             </dependency>
    225 
    226         </dependencies>
    227     </dependencyManagement>
    228 
    229     <build>
    230         <finalName>${project.artifactId}</finalName>
    231         <plugins>
    232             <!-- 资源文件拷贝插件 -->
    233             <plugin>
    234                 <groupId>org.apache.maven.plugins</groupId>
    235                 <artifactId>maven-resources-plugin</artifactId>
    236                 <version>2.7</version>
    237                 <configuration>
    238                     <encoding>UTF-8</encoding>
    239                 </configuration>
    240             </plugin>
    241             <!-- java编译插件 -->
    242             <plugin>
    243                 <groupId>org.apache.maven.plugins</groupId>
    244                 <artifactId>maven-compiler-plugin</artifactId>
    245                 <version>3.2</version>
    246                 <configuration>
    247                     <source>1.7</source>
    248                     <target>1.7</target>
    249                     <encoding>UTF-8</encoding>
    250                 </configuration>
    251             </plugin>
    252         </plugins>
    253         <pluginManagement>
    254             <plugins>
    255                 <!-- 配置Tomcat插件 -->
    256                 <plugin>
    257                     <groupId>org.apache.tomcat.maven</groupId>
    258                     <artifactId>tomcat7-maven-plugin</artifactId>
    259                     <version>2.2</version>
    260                 </plugin>
    261             </plugins>
    262         </pluginManagement>
    263     </build>
    264 </project>

      如下所示:

    2.project
    common
    jar
    继承parent
    pom包括所有的jar包依赖项,黄色可删除

    pom文件用以下文件替代:

     1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     2     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     3     <modelVersion>4.0.0</modelVersion>
     4     <parent>
     5         <groupId>cn.e3mall</groupId>
     6         <artifactId>e3-parent</artifactId>
     7         <version>0.0.1-SNAPSHOT</version>
     8     </parent>
     9     <groupId>cn.e3mall</groupId>
    10     <artifactId>e3-common</artifactId>
    11     <version>0.0.1-SNAPSHOT</version>
    12     <dependencies>
    13         <!-- 时间操作组件 -->
    14         <dependency>
    15             <groupId>joda-time</groupId>
    16             <artifactId>joda-time</artifactId>
    17         </dependency>
    18         <!-- Apache工具组件 -->
    19         <dependency>
    20             <groupId>org.apache.commons</groupId>
    21             <artifactId>commons-lang3</artifactId>
    22         </dependency>
    23         <dependency>
    24             <groupId>org.apache.commons</groupId>
    25             <artifactId>commons-io</artifactId>
    26         </dependency>
    27         <dependency>
    28             <groupId>commons-net</groupId>
    29             <artifactId>commons-net</artifactId>
    30         </dependency>
    31         <!-- Jackson Json处理工具包 -->
    32         <dependency>
    33             <groupId>com.fasterxml.jackson.core</groupId>
    34             <artifactId>jackson-databind</artifactId>
    35         </dependency>
    36         <!-- httpclient -->
    37         <dependency>
    38             <groupId>org.apache.httpcomponents</groupId>
    39             <artifactId>httpclient</artifactId>
    40         </dependency>
    41         <!-- quartz任务调度框架 -->
    42         <dependency>
    43             <groupId>org.quartz-scheduler</groupId>
    44             <artifactId>quartz</artifactId>
    45         </dependency>
    46         <!-- 单元测试 -->
    47         <dependency>
    48             <groupId>junit</groupId>
    49             <artifactId>junit</artifactId>
    50             <scope>test</scope>
    51         </dependency>
    52         <!-- 日志处理 -->
    53         <dependency>
    54             <groupId>org.slf4j</groupId>
    55             <artifactId>slf4j-log4j12</artifactId>
    56         </dependency>
    57     </dependencies>
    58 </project>


    3.project
    manager
    pom
    继承parent
    pom 依赖common

    用以下文件替换此模块的pom.xml文件:

     1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     2     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     3     <modelVersion>4.0.0</modelVersion>
     4     <parent>
     5         <groupId>cn.e3mall</groupId>
     6         <artifactId>e3-parent</artifactId>
     7         <version>0.0.1-SNAPSHOT</version>
     8     </parent>
     9     <groupId>cn.e3mall</groupId>
    10     <artifactId>e3-manager</artifactId>
    11     <version>0.0.1-SNAPSHOT</version>
    12     <packaging>pom</packaging>
    13     <dependencies>
    14         <dependency>
    15             <groupId>cn.e3mall</groupId>
    16             <artifactId>e3-common</artifactId>
    17             <version>0.0.1-SNAPSHOT</version>
    18         </dependency>
    19     </dependencies>
    20     <modules>
    21         <module>e3-manager-dao</module>
    22         <module>e3-manager-pojo</module>
    23         <module>e3-manager-interface</module>
    24         <module>e3-manager-service</module>
    25         <module>e3-manager-web</module>
    26     </modules>
    27     
    40 </project>

    4.moudle
    manager-pojo
    jar

    5.moudle
    manager-dao
    jar
    pom 依赖pojo、mybatis、MySql、连接池

    用以下文件替换此模块的pom.xml文件:

     1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     2     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     3     <modelVersion>4.0.0</modelVersion>
     4     <parent>
     5         <groupId>cn.e3mall</groupId>
     6         <artifactId>e3-manager</artifactId>
     7         <version>0.0.1-SNAPSHOT</version>
     8     </parent>
     9     <artifactId>e3-manager-dao</artifactId>
    10     <dependencies>
    11         <dependency>
    12             <groupId>cn.e3mall</groupId>
    13             <artifactId>e3-manager-pojo</artifactId>
    14             <version>0.0.1-SNAPSHOT</version>
    15         </dependency>
    16         <!-- 添加对mybatis的依赖 -->
    17         <dependency>
    18             <groupId>org.mybatis</groupId>
    19             <artifactId>mybatis</artifactId>
    20         </dependency>
    21         <dependency>
    22             <groupId>org.mybatis</groupId>
    23             <artifactId>mybatis-spring</artifactId>
    24         </dependency>
    25         <dependency>
    26             <groupId>com.github.miemiedev</groupId>
    27             <artifactId>mybatis-paginator</artifactId>
    28         </dependency>
    29         <dependency>
    30             <groupId>com.github.pagehelper</groupId>
    31             <artifactId>pagehelper</artifactId>
    32         </dependency>
    33         <!-- MySql -->
    34         <dependency>
    35             <groupId>mysql</groupId>
    36             <artifactId>mysql-connector-java</artifactId>
    37         </dependency>
    38         <!-- 连接池 -->
    39         <dependency>
    40             <groupId>com.alibaba</groupId>
    41             <artifactId>druid</artifactId>
    42         </dependency>
    43     </dependencies>
    44 </project>

    6.moudle
    manager-interface
    jar
    pom 依赖pojo

     用以下文件替换此模块的pom.xml文件:

     1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     2     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     3     <modelVersion>4.0.0</modelVersion>
     4     <parent>
     5         <groupId>cn.e3mall</groupId>
     6         <artifactId>e3-manager</artifactId>
     7         <version>0.0.1-SNAPSHOT</version>
     8     </parent>
     9     <artifactId>e3-manager-interface</artifactId>
    10     <dependencies>
    11         <dependency>
    12             <groupId>cn.e3mall</groupId>
    13             <artifactId>e3-manager-pojo</artifactId>
    14             <version>0.0.1-SNAPSHOT</version>
    15         </dependency>
    16     </dependencies>
    17 </project>

    7.moudle
    manager-service
    enter(jar)
    pom 依赖dao、interface、spring

      用以下文件替换此模块的pom.xml文件:

     1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     2     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     3     <modelVersion>4.0.0</modelVersion>
     4     <parent>
     5         <groupId>cn.e3mall</groupId>
     6         <artifactId>e3-manager</artifactId>
     7         <version>0.0.1-SNAPSHOT</version>
     8     </parent>
     9     <artifactId>e3-manager-service</artifactId>
    10     <dependencies>
    11         <dependency>
    12             <groupId>cn.e3mall</groupId>
    13             <artifactId>e3-manager-dao</artifactId>
    14             <version>0.0.1-SNAPSHOT</version>
    15         </dependency>
    16         <dependency>
    17             <groupId>cn.e3mall</groupId>
    18             <artifactId>e3-manager-interface</artifactId>
    19             <version>0.0.1-SNAPSHOT</version>
    20         </dependency>
    21         <!-- spring的依赖 -->
    22         <!-- Spring -->
    23         <dependency>
    24             <groupId>org.springframework</groupId>
    25             <artifactId>spring-context</artifactId>
    26         </dependency>
    27         <dependency>
    28             <groupId>org.springframework</groupId>
    29             <artifactId>spring-beans</artifactId>
    30         </dependency>
    31         <dependency>
    32             <groupId>org.springframework</groupId>
    33             <artifactId>spring-webmvc</artifactId>
    34         </dependency>
    35         <dependency>
    36             <groupId>org.springframework</groupId>
    37             <artifactId>spring-jdbc</artifactId>
    38         </dependency>
    39         <dependency>
    40             <groupId>org.springframework</groupId>
    41             <artifactId>spring-aspects</artifactId>
    42         </dependency>
    43         <dependency>
    44             <groupId>org.springframework</groupId>
    45             <artifactId>spring-jms</artifactId>
    46         </dependency>
    47         <dependency>
    48             <groupId>org.springframework</groupId>
    49             <artifactId>spring-context-support</artifactId>
    50         </dependency>
    51     </dependencies>
    52 </project>

    8.moudle
    manager-web
    war
    pom 依赖service、jsp相关
    (javaEE Tools--> Generate Deploy Descriptor)war需要补全目录结构src/main/webapp/WEB-INF/web.xml文件

     

    用以下文件替换此模块的pom.xml文件:

     1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     2     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     3     <modelVersion>4.0.0</modelVersion>
     4     <parent>
     5         <groupId>cn.e3mall</groupId>
     6         <artifactId>e3-manager</artifactId>
     7         <version>0.0.1-SNAPSHOT</version>
     8     </parent>
     9     <artifactId>e3-manager-web</artifactId>
    10     <packaging>war</packaging>
    11     <dependencies>
    12         <dependency>
    13         <groupId>cn.e3mall</groupId>
    14         <artifactId>e3-manager-service</artifactId>
    15         <version>0.0.1-SNAPSHOT</version>
    16         </dependency>
    17         <!-- JSP相关 -->
    18         <dependency>
    19             <groupId>jstl</groupId>
    20             <artifactId>jstl</artifactId>
    21         </dependency>
    22         <dependency>
    23             <groupId>javax.servlet</groupId>
    24             <artifactId>servlet-api</artifactId>
    25             <scope>provided</scope>
    26         </dependency>
    27         <dependency>
    28             <groupId>javax.servlet</groupId>
    29             <artifactId>jsp-api</artifactId>
    30             <scope>provided</scope>
    31         </dependency>
    32     </dependencies>
    33 </project>

    此时项目还出错,只需进行如下操作即可:

    则项目不会报错:

    9.配置Tomcat插件
    manager的pom配置Tomcat插件

    在manager的pom.xml后加入以下:

     1 <!-- 配置tomcat插件 -->
     2     <build>
     3         <plugins>
     4             <plugin>
     5                 <groupId>org.apache.tomcat.maven</groupId>
     6                 <artifactId>tomcat7-maven-plugin</artifactId>
     7                 <configuration>
     8                     <port>8080</port>
     9                     <path>/</path>
    10                 </configuration>
    11             </plugin>
    12         </plugins>
    13     </build>

    此段加在如图位置:

    10.parent+common
    Run as——>Maven Install
    本地仓库的cn/e3mall下就会有该文件了

     


    11.manager-web/src/main/webapp下新建index.jsp
    UTF-8

    用以下文件替换该index.jsp:

     1 <%@ page language="java" contentType="text/html; charset=UTF-8"
     2     pageEncoding="UTF-8"%>
     3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
     4 <html>
     5 <head>
     6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     7 <title>Insert title here</title>
     8 </head>
     9 <body>
    10     <h1>hello,世界,您好!</h1>
    11 </body>
    12 </html>

    12.manager
    Run as——>Maven Build
    clean tomcat7:run

     

     

     

     二、SVN的使用:

     在试验成功之前,我还犹豫过,一台电脑上的代码提交到这台上会不会不行,但是现在证明这是可行的,本来理论也是可行的。

    1.下载SVNServer端https://www.visualsvn.com/downloads/

      选择如下适合电脑版本的下载:

    2.按其他程序步骤安装SVNServer

     

     3.Eclipse安装SVN

     

    因为我开始安装Subclipse 1.6.x,出错,所以后面安装了Subclipse 1.8.x,步骤一样,但是显示有些错误,在此我只是让你一开始就安装Subclipse 1.8.x的。

     

    有错误,就update maven project:

     

    为排除错误,先设置一下SVN接口如下所示:

    4.下面开始提交代码:

     

     

     

     

    忽略Setting和project,让其不显示:

     

     提交代码:这里提交后,要按个同步按钮:看是否真全部一致了,不一致要更新,再提交;一致就不用管了。

     

     

     这样说明一致了,不需要再更新提交了。

    切换SVN和项目目录如下图:

     

     

    全部项目忽略项设置:

     

     

    继续提交代码至SVN:

     

     

     

     

    忽略target设置:

     

     

    SVN的服务器端有提交了3个项目,查看如下: 

     

     从刚刚查看manager下目录,可知manager下包括pojo、dao、interface、service、web5个项,故把这5项的依赖删除,再重新从SVN里导出。

     不是彻底删除代码,不需要打勾:

    稍等片刻后:

    5.从SVN 获取代码:

        为了验证svn的代码是提交的代码,把已有的项目全部删除,再重新导入

    确定项目所在硬盘也无相关信息:

    结论:项目所在硬盘无相关信息

    Refresh,再确认一下: 

     

     导入项目:

     

     

     转换为Maven项目:

     

     

     

     

     

     

    作为一个Java初学者,就这段时间的短浅入门做个记录,以便更多初学者更快入手,因是先探索后记录,各项目的细节之处请自行忽略,重要的是步骤,其他不足之处请留言,谢谢!

  • 相关阅读:
    mongodb教程
    redis高级知识
    memcached删除机制与大数据缓存问题
    nginx 运维基础
    mysql 集群与分区
    Memcached之缓存雪崩,缓存穿透,缓存预热,缓存算法
    git cz配置
    Angular零碎知识点-持续补充
    Vue学习笔记-组件
    Vue学习笔记-自定义指令生命周期函数
  • 原文地址:https://www.cnblogs.com/2186009311CFF/p/7226127.html
Copyright © 2011-2022 走看看