自动生成

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

使用注意:

代码

import java.io.*;public class Test {//包名格式//列如配置到com.wbg.ssm包下  程序会自动添加dao\controller\service\entityprivate 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\springif (springDao(url + File.separator + "spring")) {System.out.println("spring-dao.xml配置成功");} else {System.out.println("spring-dao.xml配置失败");}//\resources\springif (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>";}}

View Code

运行后

idea中ssm自动配置相关推荐

  1. java快速注释怎么配置_详解如何在低版本的Spring中快速实现类似自动配置的功能...

    在 Spring 4 后才引入了 @Conditional 等条件注解,它是 Spring Boot 中实现自动配置的最大功臣! 那么问题来了:如果我们还在使用 Spring 3.x 的老版本,这时候 ...

  2. Spring Boot 面试杀手锏:自动配置原理

    欢迎关注方志朋的博客,回复"666"获面试宝典 不论在工作中,亦或是求职面试,Spring Boot已经成为我们必知必会的技能项.除了某些老旧的政府项目或金融项目持有观望态度外,如 ...

  3. SpringBoot面试杀手锏——自动配置原理

    欢迎关注方志朋的博客,回复"666"获面试宝典 来源:blog.csdn.net/u014745069/ article/details/83820511 引言 不论在工作中,亦或 ...

  4. SpringBoot 自动配置初探

    SpringBoot 自动配置初探 @EnableAutoConfiguration @Import(AutoConfigurationImportSelector.class) selectImpo ...

  5. springboot继承组件_SpringBoot如何扩展引入的组件,以及如何自动配置组件原理

    大家都知道,当我们创建SpringBoot项目之后,我们可以在pom文件下,引入我们想要启动的组件,当我们引入之后,SpringBoot会自动帮我们配置属性! 下面我们以SpringBoot引入Spr ...

  6. Spring Security 实战:Spring Boot 下的自动配置

    点击上方蓝色"程序猿DD",选择"设为星标" 回复"资源"获取独家整理的学习资料! 来源 | 公众号「码农小胖哥」 1. 前言 我们在前几篇 ...

  7. SpringBoot 自动配置

    Springboot 自动配置 关注 "弋凡"(YiFan)微信公众号吧 记录简单笔记 做你的最爱 Springboot 是什么呐? 我管她是什么,好用就行了啊!!! spring ...

  8. Spring boot自动配置使用

    自动配置类 SpringBoot启动 会加载大量的自动配置类 1.需要的功能 有没有SpringBoot默认写好的自动配置类 2.这个自动配置类中,到底配置了哪些组件 只要,要用的组件有,就不需要再来 ...

  9. SpringBoot | 自动配置原理

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

  10. Spring Boot自动配置原理分析

    一.写在前面 随着时间的迁移Spring Boot 越来越多的出现在Java 后端程序员的视野中,Spring Boot 之所以会那么流行,很大的一个原因是自身集成了很多的Bean,简化了传统Srin ...

最新文章

  1. 皮一皮:现在想想真是幸运...
  2. JVM调优:-XX:+PrintCommandLineFlags 查看程序使用的默认JVM参数
  3. 【转】正则基础之——捕获组(capture group)
  4. 事物传递机制、应用、加载时机
  5. 前端学习(2740):重读vue电商网站50之Element-UI 组件按需加载
  6. 数据仓库入门(实验10)在Excel中查询层次结构
  7. final关键字/abstract关键字
  8. 怪盗基德的滑翔翼(信息学奥赛一本通-T286)
  9. moodle架构分析---表现层的设计(一)
  10. mfc之ListControl控件的使用
  11. Visual Studio 2017 RC版发布 自带iOS模拟器
  12. Java和jsp编程中应该注意的几个常见问题
  13. Java学生成绩管理系统(一次学会java类及容器使用,内含java编程小tips)
  14. 第13届景驰-埃森哲杯广东工业大学ACM程序设计大赛.J强迫症的序列
  15. HealthKit入门:第1部分
  16. c语言出现源文件未编译,dev运行C语言出问题
  17. 小额打款验证的小程序复用公众号资质快速认证-免打款微信认证
  18. IP地址测试用例编写
  19. 解决导出excel导出名字乱码
  20. 如何将图片素材亮度调高照片光线调亮ps教程ps学习ps基础课程教程

热门文章

  1. 微软开源可解释机器学习框架 interpret 学习实践
  2. SQLServer数据库写操作报错String or binary data would be truncated问题解决
  3. json标准格式举例_JSON格式简介及一些对应函数
  4. python2.7 UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5
  5. jpeg 转rgb c 语言_威刚推出SE770G移动固态硬盘 主打高速传输和RGB灯效
  6. java单链表上的选择排序_《Java数据结构和算法》简单排序选择排序
  7. Matlab关键规则挖掘尿片啤酒,电商数据挖掘之关联算法(一):“啤酒+尿布”的关联规则是怎么来的...
  8. JavaSE——Java8之四大函数式接口
  9. JavaSE基础——网络编程
  10. C语言真题考研pdf,中财信息学院C语言程序设计1999年考研真题.pdf