/** * Creates an artifact using information from the specified project. * * @param project a project to use as the source of the returned artifact * @param artifactFactory artifact factory used to create the artifact * @param localRepository the local repository * @return an artifact using information from the specified project */ public static Artifact createArtifactFrom( Project project, ArtifactFactory artifactFactory, File localRepository ) { logAndVerifyProjectParameters( project ); Artifact assembly = artifactFactory.createArtifactWithClassifier( project.getGroupId(), project.getArtifactId(), project.getVersion(), project.getArtifactType(), project.getPublicKeyTokenId() ); File artifactFile = ( ( ArtifactTypeHelper.isDotnetAnyGac( project.getArtifactType() ) ) ) ? PathUtil.getGlobalAssemblyCacheFileFor( assembly, localRepository) : PathUtil.getDotNetArtifact( assembly, localRepository ) ; assembly.setFile( artifactFile ); return assembly; }
return false; if ( project.getArtifactType() == null )
if ( !project.getArtifactType().equals( "pom" ) )
if ( !project.getArtifactType().equals( "pom" ) )
URI id = valueFactory.createURI( project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion() + ":" + project.getArtifactType() ); URI groupId = valueFactory.createURI( ProjectUri.GROUP_ID.getPredicate() ); URI artifactId = valueFactory.createURI( ProjectUri.ARTIFACT_ID.getPredicate() ); repositoryConnection.add( id, artifactId, valueFactory.createLiteral( project.getArtifactId() ) ); repositoryConnection.add( id, version, valueFactory.createLiteral( project.getVersion() ) ); repositoryConnection.add( id, artifactType, valueFactory.createLiteral( project.getArtifactType() ) ); if ( project.getPublicKeyTokenId() != null ) URI pid = valueFactory.createURI( parentProject.getGroupId() + ":" + parentProject.getArtifactId() + ":" + parentProject.getVersion() + ":" + project.getArtifactType() ); repositoryConnection.add( id, parent, pid ); artifactDependencies.addAll( storeProjectAndResolveDependencies( parentProject, null,
model.setArtifactId( project.getArtifactId() ); model.setVersion( project.getVersion() ); model.setPackaging( project.getArtifactType() );