forked from loafle/openapi-generator-original
Add packageName configuration to maven (#2429)
This commit is contained in:
parent
f4fa941e2b
commit
9c7d4073f4
@ -166,6 +166,12 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
@Parameter(name = "invokerPackage")
|
@Parameter(name = "invokerPackage")
|
||||||
private String invokerPackage;
|
private String invokerPackage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The default package to use for the generated objects
|
||||||
|
*/
|
||||||
|
@Parameter(name = "packageName")
|
||||||
|
private String packageName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* groupId in generated pom.xml
|
* groupId in generated pom.xml
|
||||||
*/
|
*/
|
||||||
@ -510,6 +516,10 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
configurator.setInvokerPackage(invokerPackage);
|
configurator.setInvokerPackage(invokerPackage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNotEmpty(packageName)) {
|
||||||
|
configurator.setPackageName(packageName);
|
||||||
|
}
|
||||||
|
|
||||||
if (isNotEmpty(groupId)) {
|
if (isNotEmpty(groupId)) {
|
||||||
configurator.setGroupId(groupId);
|
configurator.setGroupId(groupId);
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,7 @@ public class CodegenConfigurator implements Serializable {
|
|||||||
private String apiPackage;
|
private String apiPackage;
|
||||||
private String modelPackage;
|
private String modelPackage;
|
||||||
private String invokerPackage;
|
private String invokerPackage;
|
||||||
|
private String packageName;
|
||||||
private String modelNamePrefix;
|
private String modelNamePrefix;
|
||||||
private String modelNameSuffix;
|
private String modelNameSuffix;
|
||||||
private String groupId;
|
private String groupId;
|
||||||
@ -359,6 +360,15 @@ public class CodegenConfigurator implements Serializable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPackageName() {
|
||||||
|
return packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CodegenConfigurator setPackageName(String packageName) {
|
||||||
|
this.packageName = packageName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getGroupId() {
|
public String getGroupId() {
|
||||||
return groupId;
|
return groupId;
|
||||||
}
|
}
|
||||||
@ -566,6 +576,7 @@ public class CodegenConfigurator implements Serializable {
|
|||||||
checkAndSetAdditionalProperty(apiPackage, CodegenConstants.API_PACKAGE);
|
checkAndSetAdditionalProperty(apiPackage, CodegenConstants.API_PACKAGE);
|
||||||
checkAndSetAdditionalProperty(modelPackage, CodegenConstants.MODEL_PACKAGE);
|
checkAndSetAdditionalProperty(modelPackage, CodegenConstants.MODEL_PACKAGE);
|
||||||
checkAndSetAdditionalProperty(invokerPackage, CodegenConstants.INVOKER_PACKAGE);
|
checkAndSetAdditionalProperty(invokerPackage, CodegenConstants.INVOKER_PACKAGE);
|
||||||
|
checkAndSetAdditionalProperty(packageName, CodegenConstants.PACKAGE_NAME);
|
||||||
checkAndSetAdditionalProperty(groupId, CodegenConstants.GROUP_ID);
|
checkAndSetAdditionalProperty(groupId, CodegenConstants.GROUP_ID);
|
||||||
checkAndSetAdditionalProperty(artifactId, CodegenConstants.ARTIFACT_ID);
|
checkAndSetAdditionalProperty(artifactId, CodegenConstants.ARTIFACT_ID);
|
||||||
checkAndSetAdditionalProperty(artifactVersion, CodegenConstants.ARTIFACT_VERSION);
|
checkAndSetAdditionalProperty(artifactVersion, CodegenConstants.ARTIFACT_VERSION);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user