public static File getArtifactFileFromProjectDependencies ( AbstractWisdomMojo mojo , String artifactId , String type ) { Preconditions . checkNotNull ( mojo ) ; Preconditions . checkNotNull ( artifactId ) ; Preconditions . checkNotNull ( type ) ; // Get artifacts also resolve transitive dependencies. for ( Artifact artifact : mojo . project . getArtifacts ( ) ) { if ( artifact . getArtifactId ( ) . equals ( artifactId ) && artifact . getType ( ) . equals ( type ) ) { return artifact . getFile ( ) ; } } return null ; }
Gets the file of the dependency with the given artifact id from the project dependencies .