Commit d3d53e48 authored by liaozan's avatar liaozan 🏀

Upgrade maven-embedder version

parent 7f0508b4
......@@ -35,12 +35,12 @@
<artifactId>maven-compat</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-connector-basic</artifactId>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-http</artifactId>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
......
......@@ -41,13 +41,13 @@ public class MavenUtils {
static {
System.getProperties().setProperty(MULTIMODULE_PROJECT_DIRECTORY, "$M2_HOME");
getSettingsFile();
initSettingsFile();
}
public static void install(String workDirectory) {
log.info("Prepare to install archive from : {}", workDirectory);
MavenCli mavenCli = new MavenCli();
mavenCli.doMain(getInstallArgs(getSettingsFile().getAbsolutePath()), workDirectory, System.out, System.err);
mavenCli.doMain(getInstallArgs(SETTINGS_FILE.getAbsolutePath()), workDirectory, System.out, System.err);
log.info("Success install archive from : {}", workDirectory);
}
......@@ -57,7 +57,7 @@ public class MavenUtils {
String id = IdWorker.getIdStr();
File archetype = getArchetypeDirectory(id);
String outputDirectory = archetype.getAbsolutePath();
String[] args = getArchetypeGenerateArgs(param, getSettingsFile().getAbsolutePath(), outputDirectory);
String[] args = getArchetypeGenerateArgs(param, SETTINGS_FILE.getAbsolutePath(), outputDirectory);
mavenCli.doMain(args, null, System.out, System.err);
log.info("Generate archetype project at {}", outputDirectory);
if (param.isInitGitRepo()) {
......@@ -118,10 +118,7 @@ public class MavenUtils {
return gitLabApi.getProjectApi().getProject(projectPath);
}
private static File getSettingsFile() {
if (SETTINGS_FILE.exists()) {
return SETTINGS_FILE;
}
private static void initSettingsFile() {
Settings settings = new Settings();
settings.setLocalRepository("/data/maven/repository");
......@@ -150,7 +147,6 @@ public class MavenUtils {
} catch (IOException e) {
log.warn("Failed to write settings file", e);
}
return SETTINGS_FILE;
}
@SuppressWarnings("SpellCheckingInspection")
......
package com.schbrain.archetype.initializer.param;
import cn.hutool.core.text.StrPool;
import lombok.Data;
import org.springframework.util.StringUtils;
......@@ -58,7 +59,7 @@ public class ArchetypeGenerateParam {
public String getPackageName() {
if (!StringUtils.hasText(this.packageName)) {
this.packageName = String.format("%s.%s", this.groupId, this.getSubModuleNamePrefix());
this.packageName = String.format("%s.%s", this.groupId, this.getSubModuleNamePrefix()).replace(DELIMITER, StrPool.DOT);
}
return this.packageName;
}
......
......@@ -7,15 +7,15 @@
},
"dependencies": {
"vue": "^3.2.47",
"axios": "^1.3.4",
"ant-design-vue": "^3.2.15",
"axios": "^1.3.5",
"ant-design-vue": "^3.2.17",
"highlight.js": "^11.7.0",
"@highlightjs/vue-plugin": "^2.1.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.0.0",
"typescript": "^4.9.5",
"vite": "^4.1.4",
"@vitejs/plugin-vue": "^4.1.0",
"typescript": "^5.0.4",
"vite": "^4.2.1",
"vue-tsc": "^1.2.0"
}
}
\ No newline at end of file
......@@ -13,7 +13,7 @@
<a-input v-model:value="formState.version"/>
</a-form-item>
<a-form-item has-feedback label="PackageName" name="packageName">
<a-input v-model:value="formState.packageName" placeholder="默认为GroupId"/>
<a-input v-model:value="formState.packageName"/>
</a-form-item>
<a-form-item has-feedback label="仓库群组" name="repoGroup" v-if="formState.initGitRepo">
<a-input v-model:value="formState.repoGroup" @click="gitlabGroupVisible=true"/>
......@@ -140,10 +140,6 @@ const fetchGroupTreeList = async (initGitRepo: boolean) => {
const onGenerate = async () => {
let result = await downloadForm.value?.validate()
if (result) {
if (!result.packageName) {
result.packageName = result.groupId
}
if (result.initGitRepo) {
if (result.repoGroupId === -1) {
message.warn('Gitlab 群组不能为空!')
......
......@@ -18,10 +18,11 @@
<properties>
<revision>0.0.1-SNAPSHOT</revision>
<aether.version>1.1.0</aether.version>
<gitlab4j-api.version>5.0.1</gitlab4j-api.version>
<maven-embedder.version>3.8.5</maven-embedder.version>
<maven-embedder.version>3.9.1</maven-embedder.version>
<frontend-maven-plugin.version>1.12.1</frontend-maven-plugin.version>
<maven-resolver-connector-basic.version>1.9.7</maven-resolver-connector-basic.version>
<maven-resolver-transport-http.version>1.9.7</maven-resolver-transport-http.version>
</properties>
<modules>
......@@ -52,14 +53,14 @@
<version>${maven-embedder.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-connector-basic</artifactId>
<version>${aether.version}</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<version>${maven-resolver-connector-basic.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-http</artifactId>
<version>${aether.version}</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<version>${maven-resolver-transport-http.version}</version>
</dependency>
<dependency>
<groupId>org.gitlab4j</groupId>
......
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