自动生成

只需要创建好maven项目,然后创建一个类Test,复制代码粘贴即可

使用注意:

代码

import java.io.*;

public class Test {
//包名格式
//列如配置到com.wbg.ssm包下 程序会自动添加dao\controller\service\entity
private final static String com = "com.wbg.ssm";
//数据库名称
private final static String database = "";
//数据库账号
private final static String user = "root";
//数据库密码
private final static String password = "123456"; public static void main(String[] args) throws IOException { createStart(); } static void createStart() {
//获取当前项目的路径
String url = System.getProperty("user.dir");
System.out.println("开始配置pom.xml");
System.out.println(configPomXml(url));
url = url + File.separator + "src" + File.separator + "main";
System.out.println("开始配置resources目录");
createResources(url + File.separator + "resources");
System.out.println("完成配置resources目录");
System.out.println("开始配置webapp目录");
createWebapp(url + File.separator + "webapp");
System.out.println("完成配置webapp目录"); } //***********************Resources************************ /**
* 创建四个配置文件
* dbc.properties
* log4j.properties
* mybatis-config.xml
* spring-web.xml
*
* @return
*/
static boolean createResources(String url) {
if (createJdbcProperties(url)) {
System.out.println("jdbc.properties配置成功");
} else {
System.out.println("jdbc.properties配置失败");
}
if (log4jProperties(url)) {
System.out.println("log4j.properties配置成功");
} else {
System.out.println("log4j.properties配置失败");
}
if (mybatisConfig(url)) {
System.out.println("mybatis-config.xml配置成功");
} else {
System.out.println("mybatis-config.xml配置失败");
}
if (springWeb(url)) {
System.out.println("spring-web.xml配置成功");
} else {
System.out.println("spring-web.xml配置失败");
}
if (generatorConfig(url)) {
System.out.println("generatorConfig.xml配置成功");
} else {
System.out.println("generatorConfig.xml配置失败");
} //\resources\spring
if (springDao(url + File.separator + "spring")) {
System.out.println("spring-dao.xml配置成功");
} else {
System.out.println("spring-dao.xml配置失败");
}
//\resources\spring
if (springService(url + File.separator + "spring")) {
System.out.println("spring-service.xml配置成功");
} else {
System.out.println("spring-service.xml配置失败");
} return true;
} /**
* 创建jdbc.properties配置文件
*
* @param url 路径
* @return
*/
static boolean createJdbcProperties(String url) {
File file = new File(url, "jdbc.properties");
String context = "jdbc.driver=org.mariadb.jdbc.Driver\n" +
"jdbc.url=jdbc:mariadb://localhost:3306/" + database + "\n" +
"jdbc.user="+user+"\n" +
"jdbc.password="+password+"";
return createFile(file, context);
} /**
* 创建log4j.properties日志文件
*
* @param url 路径
* @return
*/
static boolean log4jProperties(String url) {
File file = new File(url, "log4j.properties"); String context = "# Global logging configuration\n" +
"log4j.rootLogger=ERROR, ooo\n" +
"\n" +
"# MyBatis logging configuration...\n" +
"log4j.logger." + com + ".dao=DEBUG\n" +
"\n" +
"# 规则1,名字为 ooo,向标准输出 System.err/out\n" +
"log4j.appender.ooo=org.apache.log4j.ConsoleAppender\n" +
"log4j.appender.ooo.layout=org.apache.log4j.PatternLayout\n" +
"log4j.appender.ooo.layout.ConversionPattern=%5p [%t] ~ %m%n\n";
return createFile(file, context);
} /**
* 创建mybatis-config.xml配置文件
*
* @param url 路径
* @return
*/
static boolean mybatisConfig(String url) {
File file = new File(url, "mybatis-config.xml"); String context = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
"<!DOCTYPE configuration PUBLIC \"-//mybatis.org//DTD Config 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-config.dtd\">\n" +
"\n" +
"\n" +
"<configuration>\n" +
" <settings>\n" +
" <!-- 使用jdbc的getGeneratedKeys获取数据库自增主键值 -->\n" +
" <setting name=\"useGeneratedKeys\" value=\"true\" />\n" +
" <!-- 使用列别名替换列名 默认:true -->\n" +
" <setting name=\"useColumnLabel\" value=\"true\" />\n" +
" <!-- 开启驼峰命名转换:Table {create_time} -> Entity {createTime} -->\n" +
" <setting name=\"mapUnderscoreToCamelCase\" value=\"true\" />\n" +
" </settings>\n" +
"\n" +
" <plugins>\n" +
" <plugin interceptor=\"com.github.pagehelper.PageInterceptor\" />\n" +
" </plugins>\n" +
"</configuration>";
return createFile(file, context);
} /**
* 创建spring-web.xml配置文件
*
* @return
*/
static boolean springWeb(String url) {
File file = new File(url, "spring-web.xml"); String context = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<beans xmlns=\"http://www.springframework.org/schema/beans\"\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xmlns:context=\"http://www.springframework.org/schema/context\"\n" +
" xmlns:mvc=\"http://www.springframework.org/schema/mvc\"\n" +
" xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n" +
"\thttp://www.springframework.org/schema/beans/spring-beans.xsd\n" +
"\thttp://www.springframework.org/schema/context\n" +
"\thttp://www.springframework.org/schema/context/spring-context.xsd\n" +
"\thttp://www.springframework.org/schema/mvc\n" +
"\thttp://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd\">\n" +
" <!-- 配置SpringMVC -->\n" +
" <!-- 1.开启SpringMVC注解模式 -->\n" +
" <!-- 简化配置:\n" +
" (1)自动注册DefaultAnootationHandlerMapping,AnotationMethodHandlerAdapter\n" +
" (2)提供一些列:数据绑定,数字和日期的format @NumberFormat, @DateTimeFormat, xml,json默认读写支持\n" +
" -->\n" +
" <mvc:annotation-driven />\n" +
"\n" +
" <!-- 2.静态资源默认servlet配置\n" +
" (1)加入对静态资源的处理:js,gif,png\n" +
" (2)允许使用\"/\"做整体映射\n" +
" -->\n" +
" <mvc:default-servlet-handler/>\n" +
"\n" +
" <!-- 3.配置jsp 显示ViewResolver -->\n" +
" <bean class=\"org.springframework.web.servlet.view.InternalResourceViewResolver\">\n" +
" <property name=\"viewClass\" value=\"org.springframework.web.servlet.view.JstlView\" />\n" +
" <property name=\"prefix\" value=\"/WEB-INF/jsp/\" />\n" +
" <property name=\"suffix\" value=\".jsp\" />\n" +
" </bean>\n" +
" <!-- 4.扫描web相关的bean -->\n" +
" <context:component-scan base-package=\"" + com + ".controller\" />\n" +
"</beans>";
return createFile(file, context);
} /**
* 创建spring-dao.xml配置文件
*
* @param url 路径
* @return
*/
static boolean springDao(String url) {
File file = new File(url, "spring-dao.xml");
String context = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<beans xmlns=\"http://www.springframework.org/schema/beans\"\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xmlns:tx=\"http://www.springframework.org/schema/tx\" xmlns:context=\"http://www.springframework.org/schema/context\"\n" +
" xsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd\">\n" +
"\n" +
"\n" +
"\n" +
" <!-- 配置整合mybatis过程 -->\n" +
" <!-- 1.配置数据库相关参数properties的属性:${url} -->\n" +
" <context:property-placeholder location=\"classpath:jdbc.properties\" />\n" +
"\n" +
" <!-- 2.数据库连接池 -->\n" +
" <bean id=\"dataSource\" class=\"com.mchange.v2.c3p0.ComboPooledDataSource\">\n" +
" <property name=\"driverClass\" value=\"${jdbc.driver}\" />\n" +
" <property name=\"jdbcUrl\" value=\"${jdbc.url}\" />\n" +
" <property name=\"user\" value=\"${jdbc.username}\" />\n" +
" <property name=\"password\" value=\"${jdbc.password}\" />\n" +
"\n" +
" <!-- c3p0连接池的私有属性 -->\n" +
" <property name=\"maxPoolSize\" value=\"30\" />\n" +
" <property name=\"minPoolSize\" value=\"10\" />\n" +
" <!-- 关闭连接后不自动commit -->\n" +
" <property name=\"autoCommitOnClose\" value=\"false\" />\n" +
" <!-- 获取连接超时时间 -->\n" +
" <property name=\"checkoutTimeout\" value=\"10000\" />\n" +
" <!-- 当获取连接失败重试次数 -->\n" +
" <property name=\"acquireRetryAttempts\" value=\"2\" />\n" +
" </bean>\n" +
"\n" +
" <!-- 3.配置SqlSessionFactory对象 -->\n" +
" <bean id=\"sqlSessionFactory\" class=\"org.mybatis.spring.SqlSessionFactoryBean\">\n" +
" <!-- 注入数据库连接池 -->\n" +
" <property name=\"dataSource\" ref=\"dataSource\" />\n" +
" <!-- 配置MyBaties全局配置文件:mybatis-config.xml -->\n" +
" <property name=\"configLocation\" value=\"classpath:mybatis-config.xml\" />\n" +
" <!-- 扫描entity包 使用别名 -->\n" +
" <property name=\"typeAliasesPackage\" value=\"" + com + ".entity\" />\n" +
" <!-- 扫描sql配置文件:mapper需要的xml文件 -->\n" +
" <property name=\"mapperLocations\" value=\"classpath:mapper/*.xml\" />\n" +
" </bean>\n" +
"\n" +
" <!-- 4.配置扫描Dao接口包,动态实现Dao接口,注入到spring容器中 -->\n" +
" <bean class=\"org.mybatis.spring.mapper.MapperScannerConfigurer\">\n" +
" <!-- 注入sqlSessionFactory -->\n" +
" <property name=\"sqlSessionFactoryBeanName\" value=\"sqlSessionFactory\" />\n" +
" <!-- 给出需要扫描Dao接口包 -->\n" +
" <property name=\"basePackage\" value=\"" + com + ".dao\" />\n" +
" </bean>\n" +
"\n" +
" <!--配置声明式事务管理-->\n" +
" <bean id=\"transactionManager\" class=\"org.springframework.jdbc.datasource.DataSourceTransactionManager\">\n" +
" <property name=\"dataSource\" ref=\"dataSource\" />\n" +
" </bean>\n" +
" <tx:annotation-driven proxy-target-class=\"true\" />\n" +
"\n" +
"</beans>";
return createFile(file, context);
} /**
* 创建spring-service.xml配置文件
*
* @param url 路径
* @return
*/
static boolean springService(String url) {
File file = new File(url, "spring-service.xml");
String context = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<beans xmlns=\"http://www.springframework.org/schema/beans\"\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xmlns:context=\"http://www.springframework.org/schema/context\"\n" +
" xmlns:tx=\"http://www.springframework.org/schema/tx\" xmlns:mvc=\"http://www.springframework.org/schema/mvc\"\n" +
" xmlns:aop=\"http://www.springframework.org/schema/aop\"\n" +
" xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n" +
"\thttp://www.springframework.org/schema/beans/spring-beans.xsd\n" +
"\thttp://www.springframework.org/schema/context\n" +
"\thttp://www.springframework.org/schema/context/spring-context.xsd\n" +
" http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd\">\n" +
" <!-- 扫描service包下所有使用注解的类型 -->\n" +
" <context:component-scan base-package=\"" + com + ".service\" />\n" +
" <mvc:annotation-driven />\n" +
" <!-- 启用 aspectj 方式 AOP-->\n" +
" <aop:aspectj-autoproxy proxy-target-class=\"true\" />\n" +
"</beans>";
return createFile(file, context);
} /**
* 创建generatorConfig.xml配置文件
* @param url
* @return
*/
static boolean generatorConfig(String url) {
File file = new File(url, "generatorConfig.xml");
String context = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<!DOCTYPE generatorConfiguration\n" +
" PUBLIC \"-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN\"\n" +
" \"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd\">\n" +
"\n" +
"<generatorConfiguration>\n" +
"\n" +
" <context id=\"xxx\" targetRuntime=\"MyBatis3Simple\">\n" +
"\n" +
"\n" +
" <commentGenerator>\n" +
" <property name=\"suppressDate\" value=\"true\" />\n" +
" </commentGenerator>\n" +
" <!-- 数据库连接 -->\n" +
" <jdbcConnection driverClass=\"org.mariadb.jdbc.Driver\"\n" +
" connectionURL=\"jdbc:mariadb://localhost/"+database+"\"\n" +
" userId=\""+user+"\" password=\""+password+"\">\n" +
" </jdbcConnection>\n" +
"\n" +
" <!-- Model生成规则 -->\n" +
" <javaModelGenerator targetPackage=\""+com+".entity\" targetProject=\"src/main/java\">\n" +
" <property name=\"trimStrings\" value=\"true\" />\n" +
" </javaModelGenerator>\n" +
"\n" +
" <sqlMapGenerator targetPackage=\"mapper\" targetProject=\"src/main/resources\"/>\n" +
" <!-- dao 规则 -->\n" +
" <javaClientGenerator type=\"XMLMAPPER\" targetPackage=\""+com+".dao\" targetProject=\"src/main/java\">\n" +
" <property name=\"enableSubPackages\" value=\"true\" />\n" +
" </javaClientGenerator>\n" +
" <table tableName=\"%\">\n" +
" <generatedKey column=\"id\" sqlStatement=\"Mysql\"/>\n" +
" </table>\n" +
" </context>\n" +
"</generatorConfiguration>";
return createFile(file, context);
} //***********************webapp************************
static boolean createWebapp(String url) {
if (webXml(url + File.separator + "WEB-INF")) {
System.out.println("web.xml配置成功");
} else {
System.out.println("web.xml配置失败");
}
createCSSJSDirectory(url + File.separator);
return true;
} /**
* 创建WEB-INF\web.xml配置文件
*
* @param url 路径
* @return
*/
static boolean webXml(String url) {
File file = new File(url, "web.xml");
String context = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<web-app xmlns=\"http://xmlns.jcp.org/xml/ns/javaee\"\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xsi:schemaLocation=\"http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd\"\n" +
" version=\"4.0\">\n" +
"\n" +
" <display-name>自动生成</display-name>\n" +
"\n" +
" <!--解决中文乱码-->\n" +
" <filter>\n" +
" <filter-name>encodingFilter</filter-name>\n" +
" <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>\n" +
" <async-supported>true</async-supported>\n" +
" <init-param>\n" +
" <param-name>encoding</param-name>\n" +
" <param-value>UTF-8</param-value>\n" +
" </init-param>\n" +
"\n" +
" </filter>\n" +
" <filter-mapping>\n" +
" <filter-name>encodingFilter</filter-name>\n" +
" <url-pattern>/*</url-pattern>\n" +
" </filter-mapping>\n" +
"\n" +
" <!--配置 Spring 的容器-->\n" +
" <context-param>\n" +
" <param-name>contextConfigLocation</param-name>\n" +
" <param-value>classpath:spring/spring-*.xml</param-value>\n" +
" </context-param>\n" +
" <listener>\n" +
" <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>\n" +
" </listener>\n" +
"\n" +
" <!--配置 MVC 容器-->\n" +
" <!--将所有的请求都交给 Spring MVC 处理-->\n" +
" <servlet>\n" +
" <servlet-name>app</servlet-name>\n" +
" <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>\n" +
" <init-param>\n" +
" <param-name>contextConfigLocation</param-name>\n" +
" <param-value>classpath:spring-web.xml</param-value>\n" +
" </init-param>\n" +
" </servlet>\n" +
" <servlet-mapping>\n" +
" <servlet-name>app</servlet-name>\n" +
" <url-pattern>/</url-pattern>\n" +
" </servlet-mapping>\n" +
"</web-app>";
return createFile(file, context);
} /**
* 创建css和js
*
* @param url 路径
*/
static boolean createCSSJSDirectory(String url) {
File fcss = new File(url + "css");
if (fcss.mkdirs()) {
System.out.println("成功创建css文件夹");
}
File fjs = new File(url + "js");
if (fjs.mkdirs()) {
System.out.println("成功创建js文件夹");
} return true;
} /**
* @param file 创建的文件
* @param context 文件里面的内容
*/
static boolean createFile(File file, String context) {
//获取文件
File parent = file.getParentFile();
//如果是目录
if (parent != null) {
//创建目录
parent.mkdirs();
}
try {
//创建文件
file.createNewFile();
FileWriter fileWriter = null;
try {
fileWriter = new FileWriter(file);
fileWriter.write(context);
fileWriter.flush();
fileWriter.close();
} catch (IOException e) {
return false;
}
} catch (IOException e) {
System.out.println("创建文件失败:" + e.getMessage());
}
return true;
} //***********************pom.xml************************ /**
* 配置pom.xml文件
*
* @param url 路径
*/
static String configPomXml(String url) {
File file = new File(url, "pom.xml");
InputStream inputStream = null;
byte b[] = new byte[Integer.parseInt(String.valueOf(file.length()))];
StringBuffer stringBuffer = null;
try {
inputStream = new FileInputStream(file);
inputStream.read(b);
inputStream.close();
stringBuffer = new StringBuffer(new String(b));
stringBuffer.replace(Integer.parseInt(String.valueOf(file.length())) - 10, Integer.parseInt(String.valueOf(file.length())), "");
stringBuffer.append(pomContext());
} catch (Exception e) {
return "程序出错,请重试 -- pom.xml文件配置失败";
}
if (createFile(file, stringBuffer.toString())) {
return "pom.xml文件配置完成";
}
return "pom.xml文件配置失败";
} /**
* pom.xml配置文件需要加的配置
*
* @return
*/
static String pomContext() {
return "<!--打包-->\n" +
" <packaging>war</packaging>\n" +
" <!--设置编码-->\n" +
" <properties>\n" +
" <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n" +
" <maven.compiler.source>1.8</maven.compiler.source>\n" +
" <maven.compiler.target>1.8</maven.compiler.target>\n" +
" <spring.version>5.1.0.RELEASE</spring.version>\n" +
" </properties>\n" +
" <!--引入文件-->\n" +
" <dependencies>\n" +
" <!-- Spring Web MVC -->\n" +
" <dependency>\n" +
" <groupId>org.springframework</groupId>\n" +
" <artifactId>spring-web</artifactId>\n" +
" <version>${spring.version}</version>\n" +
" </dependency>\n" +
" <dependency>\n" +
" <groupId>org.springframework</groupId>\n" +
" <artifactId>spring-webmvc</artifactId>\n" +
" <version>${spring.version}</version>\n" +
" </dependency>\n" +
"\n" +
" <!-- servlet 系列的支持 -->\n" +
" <dependency>\n" +
" <groupId>javax</groupId>\n" +
" <artifactId>javaee-api</artifactId>\n" +
" <version>8.0</version>\n" +
" <scope>provided</scope>\n" +
" </dependency>\n" +
" <dependency>\n" +
" <groupId>javax.servlet</groupId>\n" +
" <artifactId>jstl</artifactId>\n" +
" <version>1.2</version>\n" +
" </dependency>\n" +
"\n" +
" <dependency>\n" +
" <groupId>com.github.pagehelper</groupId>\n" +
" <artifactId>pagehelper</artifactId>\n" +
" <version>5.1.7</version>\n" +
" </dependency>\n" +
"\n" +
" <!-- Springframework -->\n" +
" <dependency>\n" +
" <groupId>org.springframework</groupId>\n" +
" <artifactId>spring-context</artifactId>\n" +
" <version>${spring.version}</version>\n" +
" </dependency>\n" +
" <dependency>\n" +
" <groupId>org.springframework</groupId>\n" +
" <artifactId>spring-jdbc</artifactId>\n" +
" <version>${spring.version}</version>\n" +
" </dependency>\n" +
" <dependency>\n" +
" <groupId>org.springframework</groupId>\n" +
" <artifactId>spring-aop</artifactId>\n" +
" <version>${spring.version}</version>\n" +
" </dependency>\n" +
" <dependency>\n" +
" <groupId>org.aspectj</groupId>\n" +
" <artifactId>aspectjweaver</artifactId>\n" +
" <version>1.9.1</version>\n" +
" </dependency>\n" +
"\n" +
" <!-- MyBatis -->\n" +
" <dependency>\n" +
" <groupId>org.mybatis</groupId>\n" +
" <artifactId>mybatis</artifactId>\n" +
" <version>3.4.6</version>\n" +
" </dependency>\n" +
" <dependency>\n" +
" <groupId>org.mybatis</groupId>\n" +
" <artifactId>mybatis-spring</artifactId>\n" +
" <version>1.3.2</version>\n" +
" </dependency>\n" +
"\n" +
" <!-- 数据库驱动以及数据库连接池-->\n" +
" <dependency>\n" +
" <groupId>org.mariadb.jdbc</groupId>\n" +
" <artifactId>mariadb-java-client</artifactId>\n" +
" <version>2.3.0</version>\n" +
" </dependency>\n" +
" <dependency>\n" +
" <groupId>com.mchange</groupId>\n" +
" <artifactId>c3p0</artifactId>\n" +
" <version>0.9.5.2</version>\n" +
" </dependency>\n" +
"\n" +
" <!-- 日志框架 -->\n" +
" <dependency>\n" +
" <groupId>log4j</groupId>\n" +
" <artifactId>log4j</artifactId>\n" +
" <version>1.2.17</version>\n" +
" </dependency>\n" +
"\n" +
" <!-- 通用工具 -->\n" +
" <dependency>\n" +
" <groupId>com.fasterxml.jackson.core</groupId>\n" +
" <artifactId>jackson-databind</artifactId>\n" +
" <version>2.9.7</version>\n" +
" </dependency>\n" +
"\n" +
" <!-- 单元测试 -->\n" +
" <dependency>\n" +
" <groupId>org.springframework</groupId>\n" +
" <artifactId>spring-test</artifactId>\n" +
" <version>${spring.version}</version>\n" +
" <scope>test</scope>\n" +
" </dependency>\n" +
"\n" +
" <dependency>\n" +
" <groupId>junit</groupId>\n" +
" <artifactId>junit</artifactId>\n" +
" <version>4.12</version>\n" +
" <scope>test</scope>\n" +
" </dependency>\n" +
" </dependencies>\n" +
" <build>\n" +
" <finalName>contact</finalName>\n" +
" <plugins>\n" +
" <plugin>\n" +
" <groupId>org.mybatis.generator</groupId>\n" +
" <artifactId>mybatis-generator-maven-plugin</artifactId>\n" +
" <version>1.3.7</version>\n" +
" <dependencies>\n" +
" <dependency>\n" +
" <groupId>org.mariadb.jdbc</groupId>\n" +
" <artifactId>mariadb-java-client</artifactId>\n" +
" <version>2.3.0</version>\n" +
" </dependency>\n" +
" </dependencies>\n" +
" </plugin>\n" +
" </plugins>\n" +
"\n" +
" <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->\n" +
" <plugins>\n" +
" <plugin>\n" +
" <artifactId>maven-clean-plugin</artifactId>\n" +
" <version>3.0.0</version>\n" +
" </plugin>\n" +
" <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->\n" +
" <plugin>\n" +
" <artifactId>maven-resources-plugin</artifactId>\n" +
" <version>3.0.2</version>\n" +
" </plugin>\n" +
" <plugin>\n" +
" <artifactId>maven-compiler-plugin</artifactId>\n" +
" <version>3.7.0</version>\n" +
" </plugin>\n" +
" <plugin>\n" +
" <artifactId>maven-surefire-plugin</artifactId>\n" +
" <version>2.20.1</version>\n" +
" </plugin>\n" +
" <plugin>\n" +
" <artifactId>maven-war-plugin</artifactId>\n" +
" <version>3.2.0</version>\n" +
" </plugin>\n" +
" <plugin>\n" +
" <artifactId>maven-install-plugin</artifactId>\n" +
" <version>2.5.2</version>\n" +
" </plugin>\n" +
" <plugin>\n" +
" <artifactId>maven-deploy-plugin</artifactId>\n" +
" <version>2.8.2</version>\n" +
" </plugin>\n" +
" </plugins>\n" +
" </pluginManagement>\n" +
" </build>\n\n" +
"</project>";
} }

运行后

idea中ssm自动配置的更多相关文章

  1. 头秃了,Spring Boot 自动配置了解一波~

    持续原创输出,点击上方蓝字关注我 目录 前言 源码版本 @SpringBootApplication干了什么? @EnableAutoConfiguration干了什么? 总结 前言 为什么Sprin ...

  2. spring boot实战(第十三篇)自动配置原理分析

    前言 spring Boot中引入了自动配置,让开发者利用起来更加的简便.快捷,本篇讲利用RabbitMQ的自动配置为例讲分析下Spring Boot中的自动配置原理. 在上一篇末尾讲述了Spring ...

  3. SpringBoot 源码解析 (五)----- Spring Boot的核心能力 - 自动配置源码解析

    在上一篇博客中分析了springBoot启动流程,大体的轮廓只是冰山一角.今天就来看一下springBoot的亮点功能:自动化装配功能. 先从@SpringBootApplication开始.在启动流 ...

  4. springboot mvc自动配置(目录)

    对于长时间基于spring框架做web开发的我们,springmvc几乎成为了开发普通web项目的标配.本系列文章基于快速启动的springboot,将从源码角度一点点了解springboot中mvc ...

  5. 我是如何做到springboot自动配置原理解析

    一前言 springboot 2.0.0版本分析,整体的自动配置流程如下: 具体配置参考官方文档:springboot-doc 二 @SpringBootApplication 核心注解@Spring ...

  6. Spring Boot2 系列教程(二十一) | 自动配置原理

    微信公众号:一个优秀的废人.如有问题,请后台留言,反正我也不会听. 前言 这个月过去两天了,这篇文章才跟大家见面,最近比较累,大家见谅下.下班后闲着无聊看了下 SpringBoot 中的自动配置,把我 ...

  7. Springboot学习:底层依赖与自动配置的原理

    springboot依赖的父项目 我们在创建springboot项目的时候,设置了一个父项目: 这个项目可以点进去,可以发现它依赖于另一个父项目 再次点进去,发现没有依赖父项目了 观察这个项目的pom ...

  8. 面试题: SpringBoot 的自动配置原理

    个人博客网:https://wushaopei.github.io/    (你想要这里多有) 3.Spring Boot 的自动配置原理 package com.mmall; import org. ...

  9. Spring Boot面试杀手锏————自动配置原理

    转:https://blog.csdn.net/u014745069/article/details/83820511 引言不论在工作中,亦或是求职面试,Spring Boot已经成为我们必知必会的技 ...

随机推荐

  1. vsphere client 创建虚拟机 如何关联到本地iso文件

    问题:以前用过vmere 创建虚拟机,都要在虚拟机启动之前配置系统镜像文件,第一次使用vspere client时在创建虚拟机后,我就想着应该先配置,再启动,其实,非也,应该这样,先启动虚拟机,在点按 ...

  2. 原生JS编写getByClass、addClass、removeClass、hasClass

    前言: 年后换了工作,在现在的公司写交互主要使用JS原生:刚刚入门前端的时候写交互一直用的原生JS,虽然用的不怎么样.后来去之前的公司之后,leader主张把jQuery用好,JS原生自然就熟练了:一 ...

  3. Python入门-深浅拷贝

    首先我们在这里先补充一下基础数据类型的一些知识: 一.循环删除 1.前面我们学了列表,字典和集合的一些操作方法:增删改查,现在我们来看一下这个问题: 有这样一个列表: lst = ['周杰伦','周润 ...

  4. css设置一行显示,超出部分显示...

    碰到一些介绍时候需要一行显示,然后超出部分用...替代 white-space: nowrap;不换行显示text-overflow: ellipsis;以...显示overflow: hidden; ...

  5. vue.js与angular.js的区别(个人)

    刚进入实训 讲师就要发一些什么比较高大上的东西,本人才疏学浅  浅浅的分享一下angularjs 和vue.js的区别.只是简单的理解一下 大神勿喷. 生实训之前学习的angular.js 只是理解了 ...

  6. 将ReportingService 2008配置为匿名访问 - 转载

    众所周知在ReportingService 2008中微软取消了匿名访问,我们再也不能像2005时那样靠修改IIS来实现匿名访问了.但在微软MSDN BLOG中还是提供了以下这种设置匿名访问的方式. ...

  7. ArcGIS DataStore手册——管理篇

    第二章:ArcGIS DataStore管理维护 1.备份管理 备份的目的在于发生原始数据损坏或其他突发情况时,可避免数据丢失,并可快速的使用备份数据来恢复,以保证服务仍可使用. 单机模式下,可使用D ...

  8. unity中Animation与Animator的区别

    Animation:单一动画,一般使用在单一动画播放.占用资源小. Animator:多个动画,可用控制器切换多个动画播放.占用资源大.

  9. 用两个栈实现队列(C++ 和 Python 实现)

    (说明:本博客中的题目.题目详细说明及参考代码均摘自 “何海涛<剑指Offer:名企面试官精讲典型编程题>2012年”) 题目 用两个栈实现一个队列.队列的声明如下,请实现它的两个函数 a ...

  10. js结构化命名的思考

    var koooke ={androidShare:{ show : function() {alert(1000)}}};koooke.androidShare.show(); 以上JS是偶然缩写. ...