0
我正在为Maven编写一个MojoHaus plugin的扩展。 我的项目是this GitHub repository。使用maven-plugin-plugin使用help-mojo阶段编译Maven插件
当我尝试运行mvn clean install
,编译失败,出现以下错误信息:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.4:helpmojo
(help-mojo) on project yaml-properties-maven-plugin: Execution help-mojo of goal
org.apache.maven.plugins:maven-plugin-plugin:3.4:helpmojo failed: syntax error @[11,22] in
file:/home/user/workspace/yaml-properties-maven-plugin/src/main/java/org/codehaus/mojo/properties/ResourceType.java -> [Help 1]
类ResourceType
样子:
package org.codehaus.mojo.properties;
import java.util.HashSet;
import java.util.Set;
public enum ResourceType {
PROPERTIES(".properties"),
YAML(new String[]{".yml", ".yaml"});
private final Set<String> fileExtensions;
ResourceType(final String... fileExtensions) {
this.fileExtensions = new HashSet<String>();
for(final String fileExtension: fileExtensions){
this.fileExtensions.add(fileExtension);
}
}
public static Set<String> allFileExtensions(final ResourceType... resourceTypes) {
final Set<String> extensions = new HashSet<String>();
for (final ResourceType resourceType : resourceTypes) {
extensions.addAll(resourceType.fileExtensions());
}
return extensions;
}
public static ResourceType getByFileName(final String fileName) {
for (final ResourceType resourceType : ResourceType.values()) {
for (final String extension : resourceType.fileExtensions()) {
if (fileName.endsWith(extension)) {
return resourceType;
}
}
}
return null;
}
public Set<String> fileExtensions() {
return new HashSet<String>(fileExtensions);
}
}
可能是什么问题?
我没有考虑它!非常感谢 – JeanValjean