protected MavenModuleSetBuild getMavenBuild(AbstractBuild<?,?> build) { return super.getMavenBuild(((Promotion) build).getTarget()); }
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { if (build.getResult().isWorseThan(getTreshold())) return true; // build failed. Don't publish List<MavenAbstractArtifactRecord> mavenAbstractArtifactRecords = getActions(build, listener); if (mavenAbstractArtifactRecords == null || mavenAbstractArtifactRecords.isEmpty()) { listener.getLogger().println("[ERROR] No artifacts are recorded. Is this a Maven project?"); MavenEmbedder embedder = createEmbedder(listener, build); ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) embedder.lookup(ArtifactRepositoryLayout.ROLE, "default"); if (url != null) { artifactRepository = getDeploymentRepository(factory, layout, id, url); artifactRepository = getDeploymentRepository(factory, layout, mavenArtifactRecord.repositoryId, mavenArtifactRecord.repositoryUrl);
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { if(build.getResult().isWorseThan(getTreshold())) return true; // build failed. Don't publish List<MavenAbstractArtifactRecord> mars = getActions( build, listener ); if(mars==null || mars.isEmpty()) { listener.getLogger().println("No artifacts are recorded. Is this a Maven project?");
if (publisher instanceof RedeployPublisher) { isDeploying = true; deploymentThreshold = ((RedeployPublisher)publisher).getTreshold(); break;
protected List<MavenAbstractArtifactRecord> getActions(AbstractBuild<?, ?> build, BuildListener listener) { List<MavenAbstractArtifactRecord> actions = new ArrayList<>(); MavenModuleSetBuild mavenBuild = getMavenBuild(build); if (mavenBuild == null) { return actions; } for (Entry<MavenModule, MavenBuild> e : mavenBuild.getModuleLastBuilds().entrySet()) { MavenAbstractArtifactRecord a = e.getValue().getAction( MavenAbstractArtifactRecord.class ); if (a == null) { listener.getLogger().println("No artifacts are recorded for module" + e.getKey().getName() + ". Is this a Maven project?"); } else { actions.add( a ); } } return actions; }