{"record":{"id":"c5a9458c57c2bbb5","repo":"GoogleContainerTools/jib","slug":"source-has-empty-tag","errorCode":null,"errorMessage":"${source} has empty tag","messagePattern":"(.+?) has empty tag","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java","lineNumber":478,"sourceCode":"    String property = getProperty(PropertyNames.TO_IMAGE);\n    if (property != null) {\n      return property;\n    }\n    return to.image;\n  }\n\n  /**\n   * Gets the additional target image tags.\n   *\n   * @return the configured extra tags.\n   */\n  Set<String> getTargetImageAdditionalTags() {\n    String property = getProperty(PropertyNames.TO_TAGS);\n    List<String> tags =\n        property != null ? ConfigurationPropertyValidator.parseListProperty(property) : to.tags;\n    if (tags.stream().anyMatch(Strings::isNullOrEmpty)) {\n      String source = property != null ? PropertyNames.TO_TAGS : \"<to><tags>\";\n      throw new IllegalArgumentException(source + \" has empty tag\");\n    }\n    return new HashSet<>(tags);\n  }\n\n  /**\n   * Gets the target image credential helper configuration.\n   *\n   * @return configuration for the target image credential helper\n   */\n  CredHelperConfiguration getTargetImageCredentialHelperConfig() {\n    String property = getProperty(PropertyNames.TO_CRED_HELPER);\n    if (property != null) {\n      to.credHelper.setHelper(property);\n    }\n    return to.credHelper;\n  }\n\n  AuthConfiguration getTargetImageAuth() {","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java#L460-L496","documentation":"JibPluginConfiguration.getTargetImageAdditionalTags validates the additional target-image tags (from <to><tags> or the jib.to.tags property) and throws IllegalArgumentException when any tag is null or empty. The message names the source: the property name (jib.to.tags) when set via property, otherwise '<to><tags>'.","triggerScenarios":"Setting <to><tags><tag></tag></tags> (empty tag element) or passing -Djib.to.tags=tag1,,tag3 where parseListProperty yields an empty entry between commas; trailing/leading commas in the property value also create empty entries.","commonSituations":"Comma-separated property lists built from CI variables where a variable is empty, hand-edited POMs with a placeholder <tag> never filled in, or list values generated with trailing separators.","solutions":["Remove empty <tag> elements from <to><tags> in the POM.","If using -Djib.to.tags, remove stray/leading/trailing commas and empty entries from the comma-separated list.","If tags come from CI variables, guard the command so empty variables are dropped, e.g. filter empty values before joining with commas.","Verify no tag is only whitespace; replace with a valid tag string."],"exampleFix":"// before: mvn jib:build -Djib.to.tags=v1,,latest\n// after: mvn jib:build -Djib.to.tags=v1,latest","handlingStrategy":"validation","validationCode":"// Check tags before invoking Maven\nString tags = String.join(\",\", candidateTags.stream().filter(t -> t != null && !t.isBlank()).toList());\nif (candidateTags.size() != tags.split(\",\").length) throw new IllegalStateException(\"empty tag in jib.to.tags\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Filter empty strings from CI variables before composing -Djib.to.tags.","Avoid trailing/leading commas in comma-separated tag lists.","Never commit empty <tag></tag> elements in <to><tags>.","Trim whitespace on tags when generating them from templates."],"tags":["maven","jib","configuration","validation","empty-value"],"backgroundTag":"empty-required-field","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}