public String getFinalName() { return build.getFinalName(); }
public String getProjectOutputJarPath() { return Utils.forceSlashOnDir( project.getBuild().getDirectory() ) + project.getBuild().getFinalName() + "." + project.getPackaging(); }
public String getProjectTestOutputJarPath() { return Utils.forceSlashOnDir( project.getBuild().getDirectory() ) + project.getBuild().getFinalName() + "-tests.jar"; }
private File ensureThatArtifactFileIsSet(MavenProject project) { Artifact artifact = project.getArtifact(); if (artifact == null) { return null; } File oldFile = artifact.getFile(); if (oldFile != null) { return oldFile; } Build build = project.getBuild(); if (build == null) { return null; } String finalName = build.getFinalName(); String target = build.getDirectory(); if (finalName == null || target == null) { return null; } File artifactFile = new File(target, finalName + "." + project.getPackaging()); if (artifactFile.exists() && artifactFile.isFile()) { setArtifactFile(project, artifactFile); } return null; }
@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); }
if ( build.getFinalName() != null ) serializer.startTag( NAMESPACE, "finalName" ).text( build.getFinalName() ).endTag( NAMESPACE, "finalName" );
if ( childBuild.getFinalName() == null ) childBuild.setFinalName( parentBuild.getFinalName() );
if ( childBuild.getFinalName() == null ) childBuild.setFinalName( parentBuild.getFinalName() );
debugMessages ) ); dynamicBuild.setFinalName( restoreString( dynamicBuild.getFinalName(), originalInterpolatedBuild.getFinalName(), changedBuild.getFinalName(), project, config,
if ( build.getFinalName() != null ) serializer.attribute( NAMESPACE, "finalName", build.getFinalName() );
protected File getOriginalSwfFile() { File bkpOriginalFile = new File( build.getDirectory(), build.getFinalName() + "-" + originalClassifierName + ".swf" ); return bkpOriginalFile; }
protected File getJarFile() { final String jarFilePath = StringUtils.isNotEmpty(jarFile) ? jarFile : Paths.get(buildDirectoryAbsolutePath, project.getBuild().getFinalName() + ".jar").toString(); return new File(jarFilePath); }
@Override protected ArrayList<String> collectParameters(String command) { ArrayList<String> arguments = new ArrayList<>(); arguments.add(command); handleClassPath(arguments); arguments.add("-o"); arguments.add(project.getBuild().getDirectory() + "/swagger.xml"); arguments.add("-w"); String appDir = project.getBuild().getDirectory() + "/" + project.getBuild().getFinalName(); arguments.add(appDir); return arguments; }
/** * Retrieves the file that will be or is deployed. * * @return the deploy file. * @throws MojoExecutionException */ protected File getDeployFile() throws MojoExecutionException { return new File(this.deployLocation, this.project.getBuild().getFinalName() + '.' + this.getPackaging()); } }
private File getPrimaryArtifact() throws MojoExecutionException { ArtifactHandler handler = artifactHandlerManager.getArtifactHandler(project.getPackaging()); String artifactName = project.getBuild().getFinalName() + "." + handler.getExtension(); File file = new File(buildDirectory, artifactName); if (!file.exists()) { throw new MojoExecutionException("Project's primary artifact (" + file.getPath() + ") doesn't exist."); } return file; }
@Override protected File file() { final PackageType packageType = getPackageType(); final String filename; if (this.filename == null) { filename = String.format("%s.%s", project.getBuild().getFinalName(), packageType.getFileExtension()); } else { filename = this.filename; } return new File(targetDir, filename); }
@Override public String getFinalName() { return model.getBuild().getFinalName() + "." + model.getPackaging(); }
protected void repackage() throws MojoExecutionException { buildDirectory = project.getBuild().getDirectory(); outputDirectory = project.getBuild().getOutputDirectory(); finalName = project.getBuild().getFinalName(); checkPrecoditions(); copyDependencies("classes/lib"); unpackDependencies(); packageJar(); renameJars(); }
public void execute() throws MojoExecutionException, MojoFailureException { MavenProject project = getMavenContext().getProject(); File pluginFile = new File(project.getBuild().getDirectory(), project.getBuild().getFinalName() + ".jar"); getMavenGoals().copyContainerToOutputDirectory(containerVersion); getMavenGoals().debugStandaloneContainer(pluginFile); } }
public void execute() throws MojoExecutionException, MojoFailureException { MavenProject project = getMavenContext().getProject(); File pluginFile = new File(project.getBuild().getDirectory(), project.getBuild().getFinalName() + ".jar"); getMavenGoals().copyContainerToOutputDirectory(containerVersion); getMavenGoals().debugStandaloneContainer(pluginFile); } }