打算学习一下Web开发with eclipse 的全套家伙

不用不知道,现在的东西真是多呀.  记录一下折腾这些东西的过程

Eclipse

hibernate

spring

struts

jquery

css/html

maven

所有的东西一个一个捣腾过来,还真是累的吐血,不过学些新东西总是好的.

  1. 第一步就是安装maven, 本来以为要装eclipse插件才可以用的,后来看到  这个 教程才明白是怎么回事, 说白了不就是Makefile吗,搞java的人还真是啥也要别出心裁弄套新东西,不过这个貌似高级了一些.

有了maven之后就很简单了,先建一个简单的 pom.xml, 我是按照  hibernate的指导新建的文件, 可以看这里 , 但这里有个问题, 主要是没有写version, 可以参考这个讨论, 否则就会提示version不存在 等等,  所以最后我的pom.xml 是下面这个样子,这样就保留了hibernate,spring.

需要记录一下的是这个网站,可以找maven所有的package. 看起来很不错

<project xmlns="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/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.hibernate.tutorials</groupId>
    <artifactId>hibernate-tutorial</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <name>First Hibernate Tutorial</name>

    <build>
         <!-- we dont want the version to be part of the generated war file name -->
         <finalName>${artifactId}</finalName>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
	    <version>4.0.0.Final</version>
        </dependency>

        <!-- Because this is a web app, we also have a dependency on the servlet api. -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
	    <version>2.3</version>
        </dependency>

        <!-- Hibernate uses slf4j for logging, for our purposes here use the simple backend -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
	    <version>1.5.8</version>
        </dependency>

        <!-- Hibernate gives you a choice of bytecode providers between cglib and javassist -->
        <dependency>
            <groupId>javassist</groupId>
            <artifactId>javassist</artifactId>
	    <version>3.8.0.GA</version>
        </dependency>
	<dependency>
         <groupId>hsqldb</groupId>
         <artifactId>hsqldb</artifactId>
         <version>1.8.0.7</version>
      </dependency>
	

      <dependency> 
	      <groupId>org.springframework</groupId>
	      <artifactId>spring-core</artifactId>
	      <version>3.1.0.RELEASE</version>
	      
      </dependency> 
      
    </dependencies>

</project>
  1. 下一步就是整合maven 和 eclipse,这个可以通过各种plugin来实现,但目前看来用处并不是很大
原文地址:https://www.cnblogs.com/db2zos/p/2315671.html