org.eclipse.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); request.addArtifact( pomArtifact );
org.eclipse.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); request.addArtifact( pomArtifact );
public Artifact setFile( File file ) { if ( ( this.file == null ) ? file == null : this.file.equals( file ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, file, properties ); }
public Artifact setFile( File file ) { if ( ( this.file == null ) ? file == null : this.file.equals( file ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, file, properties ); }
public Artifact setProperties( Map<String, String> properties ) { if ( this.properties.equals( properties ) || ( properties == null && this.properties.isEmpty() ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, properties, file ); }
public Artifact setProperties( Map<String, String> properties ) { if ( this.properties.equals( properties ) || ( properties == null && this.properties.isEmpty() ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, properties, file ); }
public static void main( String[] args ) throws Exception { System.out.println( "------------------------------------------------------------" ); System.out.println( InstallArtifacts.class.getSimpleName() ); RepositorySystem system = Booter.newRepositorySystem(); RepositorySystemSession session = Booter.newRepositorySystemSession( system ); Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.examples", "", "jar", "0.1-SNAPSHOT" ); jarArtifact = jarArtifact.setFile( new File( "src/main/data/demo.jar" ) ); Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) ); InstallRequest installRequest = new InstallRequest(); installRequest.addArtifact( jarArtifact ).addArtifact( pomArtifact ); system.install( session, installRequest ); }
public static void main( String[] args ) throws Exception { System.out.println( "------------------------------------------------------------" ); System.out.println( DeployArtifacts.class.getSimpleName() ); RepositorySystem system = Booter.newRepositorySystem(); RepositorySystemSession session = Booter.newRepositorySystemSession( system ); Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.examples", "", "jar", "0.1-SNAPSHOT" ); jarArtifact = jarArtifact.setFile( new File( "src/main/data/demo.jar" ) ); Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) ); RemoteRepository distRepo = new RemoteRepository.Builder( "org.eclipse.aether.examples", "default", new File( "target/dist-repo" ).toURI().toString() ).build(); DeployRequest deployRequest = new DeployRequest(); deployRequest.addArtifact( jarArtifact ).addArtifact( pomArtifact ); deployRequest.setRepository( distRepo ); system.deploy( session, deployRequest ); }
public void installAndDeploy() throws InstallationException, DeploymentException { Aether aether = new Aether( "http://localhost:8081/nexus/content/groups/public", "/Users/jvanzyl/aether-repo" ); Artifact artifact = new DefaultArtifact( "com.mycompany.super", "super-core", "jar", "0.1-SNAPSHOT" ); artifact = artifact.setFile( new File( "jar-from-whatever-process.jar" ) ); Artifact pom = new SubArtifact( artifact, null, "pom" ); pom = pom.setFile( new File( "pom-from-whatever-process.xml" ) ); // Install into the local repository specified // aether.install( artifact, pom ); // Deploy to a remote reposistory // aether.deploy( artifact, pom, "http://localhost:8081/nexus/content/repositories/snapshots/" ); }
Artifact pomXMLArtifact = new SubArtifact(jarArtifact, "", "pom");
Artifact pomXMLArtifact = new SubArtifact(jarArtifact, "", "pom");
Artifact pomArtifact = new SubArtifact(artifact, "", "pom"); pomArtifact = pomArtifact.setFile(project.getFile()); deployRequest.addArtifact(pomArtifact);
Artifact pomArtifact = new SubArtifact(artifact, "", "pom"); pomArtifact = pomArtifact.setFile(project.getFile()); installRequest.addArtifact(pomArtifact);
Artifact pomArtifact = new SubArtifact(artifact, "", "pom"); pomArtifact = pomArtifact.setFile(project.getFile()); installRequest.addArtifact(pomArtifact);
Artifact metadataArtifact = new SubArtifact(zipArtifact, "", "metadata"); metadataArtifact = metadataArtifact.setFile(tmpFile);
public void installArtifact(String groupId, String artifactId, String ext, String classifier, String version, File artifactFile, File pomFile) throws Exception { Artifact jarArtifact = new DefaultArtifact(groupId, artifactId, classifier, ext, version); jarArtifact = jarArtifact.setFile(artifactFile); Artifact pomArtifact = new SubArtifact(jarArtifact, "", "pom"); pomArtifact = pomArtifact.setFile(pomFile); InstallRequest installRequest = new InstallRequest(); installRequest.addArtifact(jarArtifact ).addArtifact( pomArtifact ); InstallResult result = system.install(session, installRequest); if (!result.getArtifacts().contains(jarArtifact)) { throw new AssertionError("Could not install jar " + jarArtifact); } if (!result.getArtifacts().contains(pomArtifact)) { throw new AssertionError("Could not install pom " + jarArtifact); } }
/** * Installs the given jar into the local repository. * * @param releaseId The releaseId with which the kjar will be installed * @param jar The jar to be installed * @param pomfile The pom file to be installed together with the kjar */ public void installArtifact( AFReleaseId releaseId, File jar, File pomfile ) { Artifact jarArtifact = new DefaultArtifact( releaseId.getGroupId(), releaseId.getArtifactId(), "jar", releaseId.getVersion() ); jarArtifact = jarArtifact.setFile( jar ); Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( pomfile ); InstallRequest installRequest = new InstallRequest(); installRequest .addArtifact( jarArtifact ) .addArtifact( pomArtifact ); try { aether.getSystem().install( aether.getSession(), installRequest ); } catch (InstallationException e) { throw new RuntimeException( e ); } }
/** * Installs the given jar into the local repository. * * @param releaseId The releaseId with which the kjar will be installed * @param jar The jar to be installed * @param pomfile The pom file to be installed together with the kjar */ public void installArtifact( AFReleaseId releaseId, File jar, File pomfile ) { Artifact jarArtifact = new DefaultArtifact( releaseId.getGroupId(), releaseId.getArtifactId(), "jar", releaseId.getVersion() ); jarArtifact = jarArtifact.setFile( jar ); Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( pomfile ); InstallRequest installRequest = new InstallRequest(); installRequest .addArtifact( jarArtifact ) .addArtifact( pomArtifact ); try { aether.getSystem().install( aether.getSession(), installRequest ); } catch (InstallationException e) { throw new RuntimeException( e ); } }
/** * Deploys a jar on a remote repository. * * @param repository The remote repository where the kjar will be deployed * @param releaseId The releaseId with which the deployment will be made * @param jar The jar to be deployed * @param pomfile The pom file to be deployed together with the kjar */ public void deployArtifact( RemoteRepository repository, AFReleaseId releaseId, File jar, File pomfile ) { Artifact jarArtifact = new DefaultArtifact( releaseId.getGroupId(), releaseId.getArtifactId(), "jar", releaseId.getVersion() ); jarArtifact = jarArtifact.setFile( jar ); Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( pomfile ); DeployRequest deployRequest = new DeployRequest(); deployRequest .addArtifact( jarArtifact ) .addArtifact( pomArtifact ) .setRepository( repository ); try { aether.getSystem().deploy( aether.getSession(), deployRequest ); } catch ( DeploymentException e ) { throw new RuntimeException( e ); } }
/** * Deploys a jar on a remote repository. * * @param repository The remote repository where the kjar will be deployed * @param releaseId The releaseId with which the deployment will be made * @param jar The jar to be deployed * @param pomfile The pom file to be deployed together with the kjar */ public void deployArtifact( RemoteRepository repository, AFReleaseId releaseId, File jar, File pomfile ) { Artifact jarArtifact = new DefaultArtifact( releaseId.getGroupId(), releaseId.getArtifactId(), "jar", releaseId.getVersion() ); jarArtifact = jarArtifact.setFile( jar ); Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( pomfile ); DeployRequest deployRequest = new DeployRequest(); deployRequest .addArtifact( jarArtifact ) .addArtifact( pomArtifact ) .setRepository( repository ); try { aether.getSystem().deploy( aether.getSession(), deployRequest ); } catch ( DeploymentException e ) { throw new RuntimeException( e ); } }