protected String getName(MavenModule o) { return o.getName(); } });
protected String getName(MavenModule o) { return o.getName(); } });
public String computeRepoDescription() { StringBuilder sb = new StringBuilder(); sb.append(project.getRootModule().getName()); sb.append(':'); sb.append(computeReleaseVersion()); return sb.toString(); }
protected List<MavenAbstractArtifactRecord> getActions(AbstractBuild<?, ?> build, BuildListener listener) { List<MavenAbstractArtifactRecord> actions = new ArrayList<MavenAbstractArtifactRecord>(); if (!(build instanceof MavenModuleSetBuild)) { return actions; } for (Entry<MavenModule, MavenBuild> e : ((MavenModuleSetBuild)build).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; }
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; }
public void deploy() throws IOException, InterruptedException, NoSuchAlgorithmException { listener.getLogger().println("Deploying artifacts to " + artifactoryServer.getUrl()); Map<MavenModule, MavenBuild> mavenBuildMap = mavenModuleSetBuild.getModuleLastBuilds(); for (Map.Entry<MavenModule, MavenBuild> mavenBuildEntry : mavenBuildMap.entrySet()) { MavenBuild mavenBuild = mavenBuildEntry.getValue(); Result result = mavenBuild.getResult(); if (Result.NOT_BUILT.equals(result)) { // HAP-52 - the module build might be skipped if using incremental build listener.getLogger().println( "Module: '" + mavenBuildEntry.getKey().getName() + "' wasn't built. Skipping."); continue; } listener.getLogger().println("Deploying artifacts of module: " + mavenBuildEntry.getKey().getName()); MavenArtifactRecord mar = ActionableHelper.getLatestMavenArtifactRecord(mavenBuild); MavenArtifact mavenArtifact = mar.mainArtifact; // deploy main artifact debuggingLogger.fine("Deploying main artifact: " + artifactToString(mavenArtifact, mavenBuild)); deployArtifact(mavenBuild, mavenArtifact); if (!mar.isPOM() && mar.pomArtifact != null && mar.pomArtifact != mar.mainArtifact) { // deploy the pom if the main artifact is not the pom debuggingLogger.fine("Deploying pom artifact: " + artifactToString(mavenArtifact, mavenBuild)); deployArtifact(mavenBuild, mar.pomArtifact); } // deploy attached artifacts for (MavenArtifact attachedArtifact : mar.attachedArtifacts) { debuggingLogger.fine("Deploying attached artifact: " + artifactToString(mavenArtifact, mavenBuild)); deployArtifact(mavenBuild, attachedArtifact); } } }
" already contains a module called " + item.getName());
private void gatherModuleAndDependencyInfo(MavenModuleSetBuild mavenModulesBuild) { Map<MavenModule, MavenBuild> mavenBuildMap = mavenModulesBuild.getModuleLastBuilds(); List<Module> modules = Lists.newArrayList(); for (Map.Entry<MavenModule, MavenBuild> moduleBuild : mavenBuildMap.entrySet()) { MavenModule mavenModule = moduleBuild.getKey(); MavenBuild mavenBuild = moduleBuild.getValue(); Result result = mavenBuild.getResult(); if (Result.NOT_BUILT.equals(result)) { // HAP-52 - the module build might be skipped if using incremental build continue; } MavenArtifactRecord mar = ActionableHelper.getLatestMavenArtifactRecord(mavenBuild); String moduleId = mavenModule.getName() + ":" + mavenModule.getVersion(); ModuleBuilder moduleBuilder = new ModuleBuilder().id(moduleId); // add artifacts moduleBuilder.addArtifact(toArtifact(mar.mainArtifact)); if (!mar.isPOM() && mar.pomArtifact != null && mar.pomArtifact != mar.mainArtifact) { moduleBuilder.addArtifact(toArtifact(mar.pomArtifact)); } for (MavenArtifact attachedArtifact : mar.attachedArtifacts) { moduleBuilder.addArtifact(toArtifact(attachedArtifact)); } addDependencies(moduleBuilder, mavenBuild); modules.add(moduleBuilder.build()); } buildInfo.setModules(modules); }