Commit 2de23af5 authored by liaozan's avatar liaozan 🏀

chore: format

parent 285fe714
<?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"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
......
......@@ -3,6 +3,7 @@ package com.schbrain.archetype.initializer.maven;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ZipUtil;
import com.schbrain.archetype.initializer.param.ArchetypeGenerateParam;
import com.schbrain.common.util.JacksonUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.maven.cli.MavenCli;
......@@ -16,12 +17,19 @@ import java.io.File;
public class MavenUtils {
public static File generate(ArchetypeGenerateParam param) {
MavenCli cli = new MavenCli();
System.getProperties().setProperty("maven.multiModuleProjectDirectory", "$M2_HOME");
log.info("Prepare to generate archetype project: {}", JacksonUtils.toJsonString(param, true));
MavenCli mavenCli = new MavenCli();
File archetype = getArchetypeDirectory(param.getArtifact());
String[] args = getArgs(param, archetype.getAbsolutePath());
cli.doMain(args, null, System.out, System.err);
log.info("Generate archetype project at {}", archetype.getAbsolutePath());
String outputDirectory = archetype.getAbsolutePath();
String[] args = getArgs(param, outputDirectory);
System.getProperties().setProperty("maven.multiModuleProjectDirectory", "$M2_HOME");
mavenCli.doMain(args, null, System.out, System.err);
log.info("Generate archetype project at {}", outputDirectory);
return ZipUtil.zip(archetype);
}
......
<!DOCTYPE html>
<html lang="">
<head>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width,initial-scale=1.0" name="viewport">
<link href="<%= BASE_URL %>favicon.ico" rel="icon">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
\ No newline at end of file
......@@ -11,14 +11,3 @@ export default {
}
}
</script>
\ No newline at end of file
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
\ No newline at end of file
<template>
<div class="generate-form">
<div class="form">
<div class="generate-form-div ">
<label for="input-packageName" class="generate-form-label">GitlabUrl</label>
<input id="input-gitlabUrl" class="generate-form-input" v-model="generateForm.gitlabUrl"
type="text">
<div class="form-div ">
<label class="form-label" for="input-packageName">GitlabUrl</label>
<input id="input-gitlabUrl" v-model="form.gitlabUrl" class="form-input" type="text">
</div>
<div class="generate-form-div ">
<label for="input-group" class="generate-form-label">Group</label>
<input type="text" id="input-group" class="generate-form-input" v-model="generateForm.group">
<div class="form-div ">
<label class="form-label" for="input-group">Group</label>
<input id="input-group" v-model="form.group" class="form-input" type="text">
</div>
<div class="generate-form-div ">
<label for="input-artifact" class="generate-form-label">Artifact</label>
<input type="text" id="input-artifact" class="generate-form-input" v-model="generateForm.artifact">
<div class="form-div ">
<label class="form-label" for="input-artifact">Artifact</label>
<input id="input-artifact" v-model="form.artifact" class="form-input" type="text">
</div>
<div class="generate-form-div ">
<label for="input-projectName" class="generate-form-label">Project Name</label>
<input id="input-projectName" class="generate-form-input" v-model="generateForm.projectName" type="text">
<div class="form-div ">
<label class="form-label" for="input-projectName">Project Name</label>
<input id="input-projectName" v-model="form.projectName" class="form-input" type="text">
</div>
<div class="generate-form-div ">
<label for="input-packageName" class="generate-form-label">Package name</label>
<input type="text" id="input-packageName" class="generate-form-input" v-model="generateForm.packageName">
<div class="form-div ">
<label class="form-label" for="input-packageName">Package name</label>
<input id="input-packageName" v-model="form.packageName" class="form-input" type="text">
</div>
<input class="generate-form-submit" type="button" @click="submit" value="下载">
<input class="form-submit" type="button" value="下载" @click="submit">
</div>
</template>
......@@ -40,7 +38,7 @@ export default {
name: "BackendStarter",
data() {
return {
generateForm: {
form: {
projectName: '',
gitlabUrl: '',
group: '',
......@@ -51,8 +49,7 @@ export default {
},
methods: {
submit: function () {
axios.post('/archetype/generate', this.generateForm, {
axios.post('/archetype/generate', this.form, {
responseType: 'blob'
}).then(res => {
const {headers, data} = res
......@@ -74,35 +71,35 @@ export default {
<style scoped>
.generate-form {
.form {
margin-left: auto;
margin-right: auto;
max-width: 500px;
background: #FFF;
padding: 30px 30px 20px 30px;
box-shadow: rgba(187, 187, 187, 1) 0 0px 20px -1px;
-webkit-box-shadow: rgba(187, 187, 187, 1) 0 0px 20px -1px;
box-shadow: rgba(187, 187, 187, 1) 0 0 20px -1px;
-webkit-box-shadow: rgba(187, 187, 187, 1) 0 0 20px -1px;
font: 12px Arial, Helvetica, sans-serif;
color: #666;
border-radius: 10px;
-webkit-border-radius: 10px;
}
.generate-form-div {
.form-div {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.generate-form-label {
.form-label {
alignment: left;
width: 150px;
}
.generate-form-input {
.form-input {
color: #555;
width: 100%;
padding: 3px 0px 3px 5px;
padding: 3px 0 3px 5px;
margin-top: 2px;
margin-right: 6px;
margin-bottom: 16px;
......@@ -113,7 +110,7 @@ export default {
outline: 0;
}
.generate-form-submit {
.form-submit {
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ff5bb0), color-stop(1, #ef027d));
border-radius: 9px;
-webkit-border-radius: 9px;
......@@ -128,6 +125,6 @@ export default {
width: 100px;
text-decoration: none;
text-align: center;
text-shadow: 1px 1px 0px #c70067;
text-shadow: 1px 1px 0 #c70067;
}
</style>
\ No newline at end of file
<?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"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment