quarkusio/quarkus · error · MojoExecutionException
appArtifact expression ${appArtifactCoords} does not follow
Error message
appArtifact expression ${appArtifactCoords} does not follow format groupId:artifactId:classifier:type:version What it means
Quarkus Maven plugin builds the application artifact from a coordinate string passed via the appArtifact configuration. The string is split on ':' and must have between 2 and 5 parts (groupId:artifactId:classifier:type:version). This MojoExecutionException is thrown when the coordinate expression does not have the expected number of colon-separated parts.
Source
Thrown at devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapProvider.java:534
* }
*/
if (!projectFile.mkdirs()) {
throw new MojoExecutionException("Failed to create the output dir " + projectFile);
}
}
}
return ResolvedDependencyBuilder.newInstance()
.setGroupId(projectArtifact.getGroupId())
.setArtifactId(projectArtifact.getArtifactId())
.setClassifier(projectArtifact.getClassifier())
.setType(projectArtifact.getArtifactHandler().getExtension())
.setVersion(projectArtifact.getVersion())
.setResolvedPath(projectFile.toPath());
}
final String[] coordsArr = appArtifactCoords.split(":");
if (coordsArr.length < 2 || coordsArr.length > 5) {
throw new MojoExecutionException(
"appArtifact expression " + appArtifactCoords
+ " does not follow format groupId:artifactId:classifier:type:version");
}
final String groupId = coordsArr[0];
final String artifactId = coordsArr[1];
String classifier = ArtifactCoords.DEFAULT_CLASSIFIER;
String type = ArtifactCoords.TYPE_JAR;
String version = null;
if (coordsArr.length == 3) {
version = coordsArr[2];
} else if (coordsArr.length > 3) {
classifier = coordsArr[2] == null ? ArtifactCoords.DEFAULT_CLASSIFIER : coordsArr[2];
type = coordsArr[3] == null ? ArtifactCoords.TYPE_JAR : coordsArr[3];
if (coordsArr.length > 4) {
version = coordsArr[4];
}
}
if (version == null) {View on GitHub (pinned to e1c734241f)
Solutions
- Fix the appArtifact value to the format groupId:artifactId[:classifier][:type][:version], e.g. com.acme:my-app:1.0.0
- Remove any extra ':'-separated segments so the string has 2 to 5 parts
- If pointing at a local artifact, use a resolvable coordinate instead of a file path
Example fix
// before <appArtifact>com.acme:my-app::jar:1.0.0:extra</appArtifact> // after <appArtifact>com.acme:my-app::jar:1.0.0</appArtifact>
Defensive patterns
Strategy: validation
Validate before calling
// validate the appArtifact coordinate before invoking the goal
String[] parts = appArtifactCoords.split(":");
if (parts.length < 2 || parts.length > 5) {
throw new IllegalArgumentException(
"appArtifact must be groupId:artifactId[:classifier][:type][:version], got: " + appArtifactCoords);
} Type guard
boolean isValidArtifactCoords(String coords) {
if (coords == null) return false;
int n = coords.split(":").length;
return n >= 2 && n <= 5;
} Try / catch
try {
mojo.appArtifact(coords);
} catch (MojoExecutionException e) {
if (e.getMessage().contains("does not follow format")) {
// fix coordinate format and retry
} else {
throw e;
}
} Prevention
- Always specify at least groupId:artifactId in appArtifact coordinates
- Prefer including the explicit version to avoid separate resolution failures
- Count colon-separated segments before pasting coordinates into pom.xml or -D flags
When it happens
Trigger: Calling the appArtifact method (via QuarkusBootstrapProvider.getApplicationArtifactBuilder) with an appArtifact string that splits into fewer than 2 or more than 5 tokens, e.g. 'com.acme:app:1.0:jar:extra:oops' or a single token 'myapp'.
Common situations: Typo in the appArtifact property in pom.xml or on the command line (-Dquarkus.appArtifact=...); pasting a coordinate with an unescaped extra colon; omitting both groupId and artifactId; using an artifact file path instead of Maven coordinates.
Related errors
- Unsupported format: ${format}
- Either the `extension` or `extensions` parameter must be set
- Cannot specify both class and method name
- The project artifact's extension is '${extension}' while thi
- Specifying a stream requires the Quarkus extension registry
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/8a30e3f7f059359d.
Report an issue: GitHub.