Skip to content

Commit

Permalink
optimize: file-generate 插件,添加 check-is-pom 属性,用于排除部分模块。
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed May 13, 2024
1 parent e2b6447 commit 31e63c8
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;

import icu.easyj.maven.plugin.mojo.AbstractEasyjMojo;
Expand Down Expand Up @@ -52,6 +53,12 @@ public class FileGenerateMojo extends AbstractEasyjMojo {
@Parameter(property = "maven.file-generate.check-has-modules-tag", defaultValue = "false")
private boolean checkHasModulesTag;

/**
* 是否需要判断pom.xml的packaging值为pom,而不是jar或其他
*/
@Parameter(property = "maven.file-generate.check-is-pom", defaultValue = "false")
private boolean checkIsPom;

/**
* 匹配
*/
Expand All @@ -76,6 +83,11 @@ public void execute() throws MojoExecutionException {
return;
}

if (checkIsPom && !Objects.equals(project.getPackaging(), "pom")) {
getLog().info("File-Generate has been skipped, because `<packaging>" + project.getPackaging() + "</packaging>` is not 'pom'.");
return;
}

if (StringUtils.isNotEmpty(moduleNamePattern)) {
boolean isMatched = false;

Expand Down

0 comments on commit 31e63c8

Please sign in to comment.