新增创建模块的代码生成功能,模块代码生成模板。
This commit is contained in:
@@ -878,8 +878,9 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
||||
if (f.exists()){
|
||||
break;
|
||||
}
|
||||
if (file.getParentFile() != null){
|
||||
file = file.getParentFile();
|
||||
File p = file.getParentFile();
|
||||
if (p != null){
|
||||
file = p;
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
@@ -916,8 +917,9 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
||||
if (f.exists()){
|
||||
return f.getPath();
|
||||
}
|
||||
if (file.getParentFile() != null){
|
||||
file = file.getParentFile();
|
||||
File p = file.getParentFile();
|
||||
if (p != null){
|
||||
file = p;
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||
<template>
|
||||
<name>controller</name>
|
||||
<name>client</name>
|
||||
<filePath>${moduleName}-client/src/main/java/${packageName}/${moduleName}/client/${subModuleName}</filePath>
|
||||
<fileName>${ClassName}ServiceClient.java</fileName>
|
||||
<content><![CDATA[
|
||||
|
||||
@@ -129,4 +129,17 @@
|
||||
<dict value="4/4/8" label="4/4/8 三列"/>
|
||||
<dict value="3/4/8" label="3/4/8 四列"/>
|
||||
</gridRowCol>
|
||||
<!-- 模块生成模板分类 -->
|
||||
<moduleTplCategory>
|
||||
<category value="module" label="生成模块代码">
|
||||
<template>module/pom.xml</template>
|
||||
<template>module/db/erm.xml</template>
|
||||
<template>module/bin/deploy.bat.xml</template>
|
||||
<template>module/bin/package.bat.xml</template>
|
||||
<template>module/src/main/java/package.xml</template>
|
||||
<template>module/src/main/resources/db/versions.xml</template>
|
||||
<template>module/src/main/resources/config/jeesite.xml</template>
|
||||
<template>module/src/main/resources/static/static.xml</template>
|
||||
</category>
|
||||
</moduleTplCategory>
|
||||
</config>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||
<template>
|
||||
<name>deploy</name>
|
||||
<filePath>${module.moduleCode}/bin</filePath>
|
||||
<fileName>deploy.bat</fileName>
|
||||
<charset>GBK</charset>
|
||||
<content><![CDATA[@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [信息] 部署工程版本到Nexus服务器。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
call mvn clean deploy -Dmaven.test.skip=true -Pdeploy
|
||||
|
||||
cd bin
|
||||
cmd /c msg %username% /time:0 /w "部署完成..."
|
||||
pause]]>
|
||||
</content>
|
||||
</template>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||
<template>
|
||||
<name>package</name>
|
||||
<filePath>${module.moduleCode}/bin</filePath>
|
||||
<fileName>package.bat</fileName>
|
||||
<charset>GBK</charset>
|
||||
<content><![CDATA[@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [信息] 打包安装工程,生成jar包文件。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
call mvn clean install -Dmaven.test.skip=true -Ppackage
|
||||
|
||||
cd bin
|
||||
cmd /c msg %username% /time:0 /w "打包完成..."
|
||||
pause]]>
|
||||
</content>
|
||||
</template>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||
<template>
|
||||
<name>pom</name>
|
||||
<filePath>${module.moduleCode}</filePath>
|
||||
<fileName>pom.xml</fileName>
|
||||
<charset></charset>
|
||||
<content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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>
|
||||
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>${jeesiteVersion}-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>jeesite-module-${module.moduleCode}</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>JeeSite Module ${module.moduleName}</name>
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<properties>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-core</artifactId>
|
||||
<version>\${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>thinkgem</id>
|
||||
<name>WangZhen</name>
|
||||
<email>thinkgem at 163.com</email>
|
||||
<roles><role>Project lead</role></roles>
|
||||
<timezone>+8</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<organization>
|
||||
<name>JeeSite</name>
|
||||
<url>http://jeesite.com</url>
|
||||
</organization>
|
||||
|
||||
</project>
|
||||
]]>
|
||||
</content>
|
||||
</template>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||
<template>
|
||||
<name>package</name>
|
||||
<filePath>${module.moduleCode}/src/main/java/com/jeesite/modules/${module.moduleCode}</filePath>
|
||||
<fileName></fileName>
|
||||
<content><![CDATA[
|
||||
|
||||
]]>
|
||||
</content>
|
||||
</template>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||
<template>
|
||||
<name>jeesite</name>
|
||||
<filePath>${module.moduleCode}/src/main/resources/config</filePath>
|
||||
<fileName>jeesite-${module.moduleCode}.yml</fileName>
|
||||
<content><![CDATA[
|
||||
# 温馨提示:不建议直接修改此文件,为了平台升级方便,建议将需要修改的参数值,复制到application.yml里进行覆盖该参数值。
|
||||
|
||||
#${module.moduleCode}:
|
||||
# enabled: true
|
||||
|
||||
]]>
|
||||
</content>
|
||||
</template>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||
<template>
|
||||
<name>versions</name>
|
||||
<filePath>${module.moduleCode}/src/main/resources/db/upgrade/${module.moduleCode}</filePath>
|
||||
<fileName>versions</fileName>
|
||||
<content><![CDATA[${module.currentVersion}]]>
|
||||
</content>
|
||||
</template>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||
<template>
|
||||
<name>static</name>
|
||||
<filePath>${module.moduleCode}/src/main/resources/static/modules/${module.moduleCode}</filePath>
|
||||
<fileName></fileName>
|
||||
<content><![CDATA[
|
||||
|
||||
]]>
|
||||
</content>
|
||||
</template>
|
||||
Reference in New Issue
Block a user