Skip to content

Commit a3088ea

Browse files
dmealingclaude
andcommitted
refactor(maven-plugin): SP-E verify Mojo clarity cleanup (no behavior change)
Drop the dead GenTarget.classname field (stored, never read) and replace the single-call genGoalName() method with a GEN_GOAL constant, matching the class's existing ARG_OUTPUT_DIR constant style. No behavior change; meta:verify regenerate+compare and the gen path are untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent cf1e522 commit a3088ea

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

server/java/maven-plugin/src/main/java/com/metaobjects/mojo/MetaDataVerifyMojo.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public class MetaDataVerifyMojo extends AbstractMetaDataMojo {
5454
/** Arg used by {@link GeneratorBase} to locate each generator's output root. */
5555
static final String ARG_OUTPUT_DIR = GeneratorBase.ARG_OUTPUTDIR;
5656

57+
/** The gen goal to suggest in the failure message ({@code groupId:artifactId:goal}). */
58+
private static final String GEN_GOAL = "metaobjects:generate";
59+
5760
@Override
5861
public void execute() throws MojoExecutionException, MojoFailureException {
5962
if (getLoader() == null) {
@@ -90,7 +93,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
9093
}
9194
Path tempDir = tempRoot.resolve("gen-" + (idx++));
9295
overrides.put(g, Collections.singletonMap(ARG_OUTPUT_DIR, tempDir.toString()));
93-
targets.add(new GenTarget(g.getClassname(), Path.of(realDir), tempDir));
96+
targets.add(new GenTarget(Path.of(realDir), tempDir));
9497
}
9598
}
9699

@@ -110,7 +113,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
110113

111114
if (!drift.isEmpty()) {
112115
StringBuilder sb = new StringBuilder();
113-
sb.append("generated code is stale — run `mvn ").append(genGoalName())
116+
sb.append("generated code is stale — run `mvn ").append(GEN_GOAL)
114117
.append("` and commit. Drifted files:");
115118
for (String d : drift) {
116119
sb.append("\n ").append(d);
@@ -125,11 +128,6 @@ public void execute() throws MojoExecutionException, MojoFailureException {
125128
}
126129
}
127130

128-
/** The gen goal to suggest in the failure message ({@code groupId:artifactId:goal}). */
129-
private String genGoalName() {
130-
return "metaobjects:generate";
131-
}
132-
133131
/**
134132
* Compare a single generator's freshly-generated temp tree against its committed tree.
135133
* Returns a list of human-readable drift descriptions (empty if in sync).
@@ -219,12 +217,10 @@ protected void executeGenerators(MetaDataLoader loader, List<Generator> generato
219217

220218
/** One generator's committed-vs-temp output-dir mapping. */
221219
private static final class GenTarget {
222-
final String classname;
223220
final Path realDir;
224221
final Path tempDir;
225222

226-
GenTarget(String classname, Path realDir, Path tempDir) {
227-
this.classname = classname;
223+
GenTarget(Path realDir, Path tempDir) {
228224
this.realDir = realDir;
229225
this.tempDir = tempDir;
230226
}

0 commit comments

Comments
 (0)