标签:
最近总是不断的在增删改查,复制, 粘贴, 有什么办法能摆脱这种现状呢? 我知道你也一定很讨厌重复的工作, 庞大的管理系统让我们把复制粘贴运用到了极致,这样永无止境下去, 跟搬砖又有什么区别?
于是, 动手来写一个代码生成器吧! 从Javabean到Dao,Mapper,Service,Controller,JSP 都交给代码生成器来完成好不好?
新建一个Maven项目,CodeGenerator, 其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.org.j2ee</groupId>
5 <artifactId>CodeGenerator</artifactId>
6 <version>0.0.1-SNAPSHOT</version>
7 <packaging>jar</packaging>
8 <name>CodeGenerator</name>
9 <url>http://www.j2ee.org.cn</url>
10 <description>Java代码生成器</description>
11
12 <properties>
13 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14 </properties>
15
16 <dependencies>
17 <dependency>
18 <groupId>junit</groupId>
19 <artifactId>junit</artifactId>
20 <version>4.10</version>
21 <scope>test</scope>
22 </dependency>
23 <dependency>
24 <groupId>commons-collections</groupId>
25 <artifactId>commons-collections</artifactId>
26 <version>3.1</version>
27 </dependency>
28 <dependency>
29 <groupId>commons-lang</groupId>
30 <artifactId>commons-lang</artifactId>
31 <version>2.4</version>
32 </dependency>
33 <dependency>
34 <groupId>commons-logging</groupId>
35 <artifactId>commons-logging</artifactId>
36 <version>1.1.1</version>
37 </dependency>
38 <dependency>
39 <groupId>dom4j</groupId>
40 <artifactId>dom4j</artifactId>
41 <version>1.6</version>
42 </dependency>
43 <dependency>
44 <groupId