Skip to content

Commit

Permalink
Refactor resolution of executed projects in devmode/codeserver
Browse files Browse the repository at this point in the history
Following the previous changes that resolved project references
to their executed project, making the resolution in addSources
reentrant calls redundant; now eagerly resolve projectList to
the executed projects too.
  • Loading branch information
tbroyer committed Jul 2, 2017
1 parent 5cfe415 commit d45999f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/net/ltgt/gwt/maven/AbstractDevModeMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ public void execute() throws MojoExecutionException, MojoFailureException {
throw new MojoExecutionException("No project found");
}

// resolve executed projects
for (int i = 0; i < projectList.size(); i++) {
MavenProject p = projectList.get(i).getExecutionProject();
if (p != null) {
projectList.set(i, p);
}
}

List<String> moduleList = new ArrayList<>();
if (StringUtils.isBlank(modules)) {
List<String> nonGwtProjects = new ArrayList<>();
Expand Down Expand Up @@ -243,9 +251,6 @@ protected boolean prependSourcesToClasspath() {

private void addSources(MavenProject p, LinkedHashSet<String> sources) {
getLog().debug("Adding sources for " + p.getId());
if (p.getExecutionProject() != null) {
p = p.getExecutionProject();
}
sources.addAll(p.getCompileSourceRoots());
ScopeArtifactFilter artifactFilter = new ScopeArtifactFilter(classpathScope);
for (Artifact artifact : p.getDependencyArtifacts()) {
Expand Down

0 comments on commit d45999f

Please sign in to comment.