Skip to content

Commit 41a3c76

Browse files
committed
Fix gwt:generate-module for relocated artifacts
Relocated artifacts don't have an associated file, despite having a packaging=jar (so being considered "added to the classpath" by their artifact handler). This shouldn't happen much, because we expect people to update their direct dependencies to their new location (and gwt:generate-module only looks at direct dependencies), but still, that's bad developer experience. Fixes #150
1 parent 51408d5 commit 41a3c76

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/net/ltgt/gwt/maven/GenerateModuleMojo.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ private boolean generateInheritsFromDependencies(XMLWriter xmlWriter) throws IOE
248248
if (!artifact.getArtifactHandler().isAddedToClasspath()) {
249249
continue;
250250
}
251+
if (artifact.getFile() == null) {
252+
// This can happen for relocated artifacts
253+
continue;
254+
}
251255
realm.addURL(artifact.getFile().toURI().toURL());
252256
}
253257
} catch (DuplicateRealmException | MalformedURLException e) {

0 commit comments

Comments
 (0)