public boolean match( NetDependency netDependency ) { return ArtifactTypeHelper.isDotnetExecutable(netDependency.getType()) || ArtifactTypeHelper.isDotnetMavenPlugin(netDependency.getType()) || netDependency.getType().equals( ArtifactType.VISUAL_STUDIO_ADDIN.getPackagingType() ) || netDependency.getType().equals( ArtifactType.SHARP_DEVELOP_ADDIN.getPackagingType() ); } }
/** * Returns a list of artifacts that match the specified parameters. If the version or type parameters are null, * then the returned list will include all versions and types. * * @param groupId the group ID of the artifact to match. This value should not be null. * @param artifactId the artifact ID of the artifact to match. This value should not be null. * @param version the version if the artifact to match. * @param type the type of artifact to match * @return a list of artifacts that match the specified parameters */ List<Artifact> getArtifactsFor( String groupId, String artifactId, String version, String type ) { List<Artifact> artifacts = new ArrayList<Artifact>(); for ( NetDependency netDependency : netDependencies ) { if ( netDependency.getGroupId().equals( groupId ) && netDependency.getArtifactId().equals( artifactId ) && ( version == null || netDependency.getVersion().equals( version ) ) && ( type == null || netDependency.getType().equals( type ) ) ) { artifacts.add( netDependencyToArtifact( netDependency ) ); } } return artifacts; }
dependency.setVersion( netDependency.getVersion() ); dependency.setScope( Artifact.SCOPE_RUNTIME ); dependency.setType( netDependency.getType() ); dependencies.add( dependency );
/** * Creates an artifact based on the information from a <code>NetDepencency</code> object. Note that all artifacts * automatically have a runtime scope since <code>NetDependencies</code> are always executables that * are intended to be executed directly from the local Maven repository. * * @param dependency the net dependency, which is the source to copy information from. * @return artifact */ private Artifact netDependencyToArtifact( NetDependency dependency ) { return artifactFactory.createDependencyArtifact( dependency.getGroupId(), dependency.getArtifactId(), VersionRange.createFromVersion( dependency.getVersion() ), dependency.getType(), dependency.getPublicKeyToken(), Artifact.SCOPE_RUNTIME, null ); } }
/** * Copies the information from a <code>NetDependency</code> object to a <code>Dependency</code> object. This method * is for converting from an NPanday specific model to a Maven model that can be used within the general Maven * framework. Note that all artifacts automatically have a runtime scope since <code>NetDependencies</code> are * always executables that are intended to be executed directly from the local Maven repository. * * @param netDependency the net dependency, which is the source to copy information from. * @return dependency */ private Dependency netDependencyToDependency( NetDependency netDependency ) { Dependency dependency = new Dependency(); dependency.setArtifactId( netDependency.getArtifactId() ); dependency.setGroupId( netDependency.getGroupId() ); dependency.setType( netDependency.getType() ); dependency.setScope( Artifact.SCOPE_RUNTIME ); dependency.setVersion( netDependency.getVersion() ); dependency.setClassifier( netDependency.getPublicKeyToken() ); return dependency; }