String (@Nullable String groupId, @Nullable String artifactId, @Nullable String version, @Nullable String scope, @Nullable String classifier) { String dependency = "<dependency>\n"; if (groupId != null) { dependency += "<groupId>" + groupId + "</groupId>\n"; } if (artifactId != null) { dependency += "<artifactId>" + artifactId + "</artifactId>\n"; } if (version != null) { dependency += "<version>" + version + "</version>\n"; } if (scope != null) { dependency += "<scope>" + scope + "</scope>\n"; } if (classifier != null) { dependency += "<classifier>" + classifier + "</classifier>\n"; } dependency += "</dependency>"; return dependency; }