private void addRelevantProjectDependenciesToClasspath ( List < Path > path ) throws MojoExecutionException { if ( this . includeProjectDependencies ) { getLog ( ) . debug ( "Project Dependencies will be included." ) ; List < Artifact > artifacts = new ArrayList <> ( ) ; List < Path > theClasspathFiles = new ArrayList <> ( ) ; collectProjectArtifactsAndClasspath ( artifacts , theClasspathFiles ) ; for ( Path classpathFile : theClasspathFiles ) { getLog ( ) . debug ( "Adding to classpath : " + classpathFile ) ; path . add ( classpathFile ) ; } for ( Artifact classPathElement : artifacts ) { getLog ( ) . debug ( "Adding project dependency artifact: " + classPathElement . getArtifactId ( ) + " to classpath" ) ; path . add ( classPathElement . getFile ( ) . toPath ( ) ) ; } } else { getLog ( ) . debug ( "Project Dependencies will be excluded." ) ; } }
Add any relevant project dependencies to the classpath . Takes includeProjectDependencies into consideration .