/** * Copyies the srcFile to the workingDir and then attaches it to the artifact. If srcFile is null, a new empty file * will be created. * * @param artifact to attach * @param workingDir where to copy the srcFile. * @param srcFile file to be attached. * @throws IOException */ public void setArtifactFile( Artifact artifact, File workingDir, File srcFile ) throws IOException { setArtifactFile( artifact, workingDir, srcFile, false ); }
/** * Creates a new empty file and attaches it to the artifact. * * @param artifact to attach the file to. * @param workingDir where to locate the new file * @throws IOException */ public void setArtifactFile( Artifact artifact, File workingDir ) throws IOException { setArtifactFile( artifact, workingDir, null, false ); }
/** * Creates an unpackable file (zip,jar etc) containing an empty file. * * @param artifact to attach * @param workingDir where to create the file. * @throws IOException */ public void setUnpackableArtifactFile( Artifact artifact, File workingDir ) throws IOException { setArtifactFile( artifact, workingDir, null, true ); }
/** * Creates an unpackable file (zip,jar etc) containing the srcFile. If srcFile is null, a new empty file will be * created. * * @param artifact to attach * @param workingDir where to create the file. * @param srcFile * @throws IOException if any */ public void setUnpackableArtifactFile( Artifact artifact, File workingDir, File srcFile ) throws IOException { setArtifactFile( artifact, workingDir, srcFile, true ); }
factory.setArtifactFile( artifact, factory.getWorkingDir() );
/** * @param groupId not null * @param artifactId not null * @param versionRange not null * @param scope not null * @param type not null * @param classifier * @param optional not null * @return a <code>DefaultArtifact</code> instance * @throws IOException if any */ public Artifact createArtifact( String groupId, String artifactId, VersionRange versionRange, String scope, String type, String classifier, boolean optional ) throws IOException { ArtifactHandler ah = new DefaultArtifactHandlerStub( type, classifier ); Artifact artifact = new DefaultArtifact( groupId, artifactId, versionRange, scope, type, classifier, ah, optional ); // i have no idea why this needs to be done manually when isSnapshot is able to figure it out. artifact.setRelease( !artifact.isSnapshot() ); if ( createFiles ) { setArtifactFile( artifact, this.workingDir, this.srcFile, this.createUnpackableFile ); } return artifact; }
/** * Creates a new empty file and attaches it to the artifact. * * @param artifact to attach the file to. * @param workingDir where to locate the new file * @throws IOException */ public void setArtifactFile( Artifact artifact, File workingDir ) throws IOException { setArtifactFile( artifact, workingDir, null, false ); }
/** * Creates an unpackable file (zip,jar etc) containing an empty file. * * @param artifact to attach * @param workingDir where to create the file. * @throws IOException */ public void setUnpackableArtifactFile( Artifact artifact, File workingDir ) throws IOException { setArtifactFile( artifact, workingDir, null, true ); }
/** * Creates an unpackable file (zip,jar etc) containing the srcFile. If srcFile is null, a new empty file will be * created. * * @param artifact to attach * @param workingDir where to create the file. * @param srcFile * @throws IOException if any */ public void setUnpackableArtifactFile( Artifact artifact, File workingDir, File srcFile ) throws IOException { setArtifactFile( artifact, workingDir, srcFile, true ); }
/** * Copyies the srcFile to the workingDir and then attaches it to the artifact. If srcFile is null, a new empty file * will be created. * * @param artifact to attach * @param workingDir where to copy the srcFile. * @param srcFile file to be attached. * @throws IOException */ public void setArtifactFile( Artifact artifact, File workingDir, File srcFile ) throws IOException { setArtifactFile( artifact, workingDir, srcFile, false ); }
factory.setArtifactFile( artifact, factory.getWorkingDir() );
/** * @param groupId not null * @param artifactId not null * @param versionRange not null * @param scope not null * @param type not null * @param classifier * @param optional not null * @return a <code>DefaultArtifact</code> instance * @throws IOException if any */ public Artifact createArtifact( String groupId, String artifactId, VersionRange versionRange, String scope, String type, String classifier, boolean optional ) throws IOException { ArtifactHandler ah = new DefaultArtifactHandlerStub( type, classifier ); Artifact artifact = new DefaultArtifact( groupId, artifactId, versionRange, scope, type, classifier, ah, optional ); // i have no idea why this needs to be done manually when isSnapshot is able to figure it out. artifact.setRelease( !artifact.isSnapshot() ); if ( createFiles ) { setArtifactFile( artifact, this.workingDir, this.srcFile, this.createUnpackableFile ); } return artifact; }