diff --git a/src/main/java/net/ltgt/gwt/maven/AbstractAddSuperSourcesMojo.java b/src/main/java/net/ltgt/gwt/maven/AbstractAddSuperSourcesMojo.java index 60ea82f3..18b4855c 100644 --- a/src/main/java/net/ltgt/gwt/maven/AbstractAddSuperSourcesMojo.java +++ b/src/main/java/net/ltgt/gwt/maven/AbstractAddSuperSourcesMojo.java @@ -29,10 +29,15 @@ public void execute() throws MojoExecutionException { throw new MojoExecutionException("Cannot relocate super-sources if moduleName is not specified"); } String targetPath = moduleName.replace('.', '/'); - // Keep only package name - targetPath = targetPath.substring(0, targetPath.lastIndexOf('/')); + // Keep only package name (if there is one) + int lastTrailingSlash = targetPath.lastIndexOf('/'); + if (lastTrailingSlash > 0) { + targetPath = targetPath.substring(0, lastTrailingSlash + 1); + } else { + targetPath = ""; + } // Relocate into 'super' subfolder - targetPath = ensureTrailingSlash(targetPath) + "super/"; + targetPath += "super/"; resource.setTargetPath(targetPath); } addResource(resource);