/** * 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; }