@ Override public void execute ( ) { if ( "pom" . equals ( project . getPackaging ( ) ) ) { return ; } File baseDir = project . getBasedir ( ) ; File mainScalaPath = new File ( baseDir , "src/main/scala" ) ; if ( mainScalaPath . isDirectory ( ) ) { String mainScalaPathStr = mainScalaPath . getAbsolutePath ( ) ; if ( ! project . getCompileSourceRoots ( ) . contains ( mainScalaPathStr ) ) { project . addCompileSourceRoot ( mainScalaPathStr ) ; getLog ( ) . debug ( "Added source directory: " + mainScalaPathStr ) ; } } File testScalaPath = new File ( baseDir , "src/test/scala" ) ; if ( testScalaPath . isDirectory ( ) ) { String testScalaPathStr = testScalaPath . getAbsolutePath ( ) ; if ( ! project . getTestCompileSourceRoots ( ) . contains ( testScalaPathStr ) ) { project . addTestCompileSourceRoot ( testScalaPathStr ) ; getLog ( ) . debug ( "Added test source directory: " + testScalaPathStr ) ; } } }
Adds default Scala sources locations to Maven project .