Refine search
public static String getKey( MavenProject project ) { return project.getGroupId() + ':' + project.getArtifactId() + ':' + project.getVersion(); }
private String getMetaSubdir() { return String.format("META-INF/docker/%s/%s/", project.getGroupId(), project.getArtifactId()); }
@SuppressWarnings({ "unchecked" }) @Override public void execute() throws MojoExecutionException, MojoFailureException { if (!CommonUtils.initSaturnHome()) throw new MojoExecutionException("The ${user.home}/.saturn/caches is not exists"); Log log = getLog(); MavenProject project = (MavenProject) getPluginContext().get("project"); String version = getSaturnVersion(project); log.info("Packing the saturn job into a zip file: version:" + version); List<File> runtimeLibFiles = new ArrayList<File>(); List<Artifact> runtimeArtifacts = project.getRuntimeArtifacts(); for (Artifact artifact : runtimeArtifacts) { runtimeLibFiles.add(artifact.getFile()); } runtimeLibFiles.add(new File(project.getBuild().getDirectory(), project.getBuild().getFinalName() + "." + project.getPackaging())); File zipFile = new File(project.getBuild().getDirectory(), project.getArtifactId() + "-" + project.getVersion() + "-" + "app.zip"); try { CommonUtils.zip(runtimeLibFiles, null, zipFile); } catch (Exception e) { e.printStackTrace(); throw new MojoExecutionException("zip " + zipFile + " failed", e); } projectHelper.attachArtifact(project, "zip", "executor", zipFile); }
@Override public int hashCode() { int hash = 17; hash = 31 * hash + getGroupId().hashCode(); hash = 31 * hash + getArtifactId().hashCode(); hash = 31 * hash + getVersion().hashCode(); return hash; }
/** * A helper method to determine the value to resume the build with {@code -rf} taking into account the * edge case where multiple modules in the reactor have the same artifactId. * <p> * {@code -rf :artifactId} will pick up the first module which matches, but when multiple modules in the * reactor have the same artifactId, effective failed module might be later in build reactor. * This means that developer will either have to type groupId or wait for build execution of all modules * which were fine, but they are still before one which reported errors. * <p>Then the returned value is {@code groupId:artifactId} when there is a name clash and * {@code :artifactId} if there is no conflict. * * @param mavenProjects Maven projects which are part of build execution. * @param failedProject Project which has failed. * @return Value for -rf flag to resume build exactly from place where it failed ({@code :artifactId} in * general and {@code groupId:artifactId} when there is a name clash). */ private String getResumeFrom( List<MavenProject> mavenProjects, MavenProject failedProject ) { for ( MavenProject buildProject : mavenProjects ) { if ( failedProject.getArtifactId().equals( buildProject.getArtifactId() ) && !failedProject.equals( buildProject ) ) { return failedProject.getGroupId() + ":" + failedProject.getArtifactId(); } } return ":" + failedProject.getArtifactId(); }
project.getArtifactId() + "-" + project.getVersion() + "-bundles.jar"); getLog().info("Building bundles jar: " + jarFile.getAbsolutePath()); createBundlesJar(jarFile, bundles);
public void addProjectReference( MavenProject project ) { projectReferences.put( getProjectReferenceId( project.getGroupId(), project.getArtifactId(), project.getVersion() ), project ); }
private String formatProjects( List<MavenProject> projects ) { StringBuilder projectNames = new StringBuilder(); Iterator<MavenProject> iterator = projects.iterator(); while ( iterator.hasNext() ) { MavenProject project = iterator.next(); projectNames.append( project.getGroupId() ).append( ":" ).append( project.getArtifactId() ); if ( iterator.hasNext() ) { projectNames.append( ", " ); } } return projectNames.toString(); }
private Set<String> getReactorProjectKeys( Collection<MavenProject> projects ) { Set<String> projectKeys = new HashSet<>( projects.size() * 2 ); for ( MavenProject project : projects ) { String key = ArtifactUtils.key( project.getGroupId(), project.getArtifactId(), project.getVersion() ); projectKeys.add( key ); } return projectKeys; }
private static String getProjectKey( MavenProject project ) { return ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() ); }
public void addProjectReference( MavenProject project ) { projectReferences.put( getProjectReferenceId( project.getGroupId(), project.getArtifactId(), project.getVersion() ), project ); }
@Inject ReactorReader( MavenSession session ) { projectsByGAV = session.getProjectMap(); projectsByGA = new HashMap<>( projectsByGAV.size() * 2 ); for ( MavenProject project : projectsByGAV.values() ) { String key = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() ); List<MavenProject> projects = projectsByGA.get( key ); if ( projects == null ) { projects = new ArrayList<>( 1 ); projectsByGA.put( key, projects ); } projects.add( project ); } repository = new WorkspaceRepository( "reactor", new HashSet<>( projectsByGAV.keySet() ) ); }
private Set<String> getIgnorableArtifacts( Collection<? extends MavenProject> projects ) { Set<String> projectIds = new HashSet<>( projects.size() * 2 ); for ( MavenProject p : projects ) { String key = ArtifactUtils.key( p.getGroupId(), p.getArtifactId(), p.getVersion() ); projectIds.add( key ); } return projectIds; }
String id = ':' + project.getArtifactId(); id = project.getGroupId() + id;
public static String getId( MavenProject project ) { return ArtifactUtils.key( project.getGroupId(), project.getArtifactId(), project.getVersion() ); }
String id = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() ); Vertex v = dag.getVertex( id ); if ( make )
protected GavLabel getGavLabel() { // Label used for this run return new GavLabel(project.getGroupId(), project.getArtifactId(), project.getVersion()); }
private ProjectProperty createProject() { ProjectProperty projectProperty = new ProjectProperty(); Map<String, Object> projectData = new HashMap<>(); addStringToMap(Project.COMPANY_NAME, companyName, getCompanyNameFromMavenProject(), projectData); addStringToMap(Project.NAME, appName, mavenProject.getArtifactId(), projectData); addStringToMap(Project.APP_ID, UUID.randomUUID().toString(), null, projectData); addStringToMap(Project.PACKAGE_NAME, packageName, (mavenProject.getGroupId() + "." + mavenProject.getArtifactId() + ".db").toLowerCase(), projectData); addStringToMap(Project.PACKAGE_LOCATION, packageLocation, null, projectData); addStringToMap(Project.ID, appName, mavenProject.getArtifactId(), projectData); addBooleanToMap(Project.ENABLED, Boolean.TRUE, projectData); addListToMap(Project.DBMSES, createDbmses(), projectData); projectProperty.merge(new DocumentPropertyComponentImpl(), new ProjectImpl(projectData)); return projectProperty; }
public Set<String> getReactorProjectKeys() { Set<String> projectKeys = new HashSet<>( items.size() * 2 ); for ( ProjectSegment projectBuild : items ) { MavenProject project = projectBuild.getProject(); String key = ArtifactUtils.key( project.getGroupId(), project.getArtifactId(), project.getVersion() ); projectKeys.add( key ); } return projectKeys; }
private void addEdgeWithParentCheck( Map projectMap, String projectRefId, MavenProject project, String id ) throws CycleDetectedException { MavenProject extProject = (MavenProject) projectMap.get( projectRefId ); if ( extProject == null ) { return; } project.addProjectReference( extProject ); MavenProject extParent = extProject.getParent(); if ( extParent != null ) { String parentId = ArtifactUtils.versionlessKey( extParent.getGroupId(), extParent.getArtifactId() ); // Don't add edge from parent to extension if a reverse edge already exists if ( !dag.hasEdge( projectRefId, id ) || !parentId.equals( id ) ) { dag.addEdge( id, projectRefId ); } } }