Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/it/test_no_sources/validate.groovy
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
try {

def file = new File(basedir, 'target')
assert !file.exists()

return true
if (file.exists()){
def targetEmpty = file.listFiles()
.findAll { it.name != "project-local-repo" }
.isEmpty()

} catch(Throwable e) {
e.printStackTrace()
return false
return targetEmpty
}

return true
6 changes: 2 additions & 4 deletions src/main/java/scala_maven/ScalaDocMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ public class ScalaDocMojo extends ScalaSourceMojoSupport implements MavenReport

@Override
protected List<File> getSourceDirectories() throws Exception {
List<String> sources = project.getCompileSourceRoots();
// Quick fix in case the user has not added the "add-source" goal.
String scalaSourceDir = FileUtils.pathOf(sourceDir, useCanonicalPath);
if (!sources.contains(scalaSourceDir)) {
sources.add(scalaSourceDir);
}
project.addCompileSourceRoot(scalaSourceDir);
List<String> sources = project.getCompileSourceRoots();
return normalize(sources);
}

Expand Down
6 changes: 2 additions & 4 deletions src/main/java/scala_maven/ScalaTestCompileMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ protected File getOutputDir() {

@Override
protected List<File> getSourceDirectories() throws Exception {
List<String> sources = project.getTestCompileSourceRoots();
String scalaSourceDir = testSourceDir.getAbsolutePath();
if (!sources.contains(scalaSourceDir)) {
sources.add(scalaSourceDir);
}
project.addTestCompileSourceRoot(scalaSourceDir);
List<String> sources = project.getTestCompileSourceRoots();
return normalize(sources);
}

Expand Down