Refine search
getLog().debug( "Compiling " + excludeJarResources.length + " patterns" ); getLog().info( "Creating debug key signed apk file " + outputFile ); createApkFile( outputFile, true ); final File unsignedOutputFile = new File( targetDirectory, finalName + "-unsigned." + APK ); getLog().info( "Creating additional unsigned apk file " + unsignedOutputFile ); createApkFile( unsignedOutputFile, false ); projectHelper.attachArtifact( project, unsignedOutputFile, classifier == null ? "unsigned" : classifier + "_unsigned" ); project.getArtifact().setFile( outputFile ); projectHelper.attachArtifact( project, AndroidExtension.APK, classifier, outputFile );
/** * Extract the source dependencies. * * @throws MojoExecutionException if it fails. */ protected void extractSourceDependencies() throws MojoExecutionException { for ( Artifact artifact : getDirectDependencyArtifacts() ) { String type = artifact.getType(); if ( type.equals( APKSOURCES ) ) { getLog().debug( "Detected apksources dependency " + artifact + " with file " + artifact.getFile() + ". Will resolve and extract..." ); final File apksourcesFile = resolveArtifactToFile( artifact ); getLog().debug( "Extracting " + apksourcesFile + "..." ); extractApksources( apksourcesFile ); } } if ( extractedDependenciesJavaResources.exists() ) { projectHelper.addResource( project, extractedDependenciesJavaResources.getAbsolutePath(), null, null ); project.addCompileSourceRoot( extractedDependenciesJavaSources.getAbsolutePath() ); } }
projectHelper.addResource(project, componentOutDir.getPath(), Collections.singletonList("**/component.properties"), Collections.emptyList()); for (Resource r : project.getBuild().getResources()) { File f = new File(r.getDirectory()); if (!f.exists()) { f = new File(project.getBasedir(), r.getDirectory()); String names = buffer.toString(); properties.put("components", names); properties.put("groupId", project.getGroupId()); properties.put("artifactId", project.getArtifactId()); properties.put("version", project.getVersion()); log.debug("No component changes detected"); return; os.close(); log.info("Generated " + outFile + " containing " + count + " Camel " + (count > 1 ? "components: " : "component: ") + names); throw new MojoExecutionException("Failed to write properties to " + outFile + ". Reason: " + e, e); log.debug("No META-INF/services/org/apache/camel/component directory found. Are you sure you have created a Camel component?");
try { if (enableGeneration == null) { String packaging = this.project.getPackaging(); enableGeneration = !"feature".equals(packaging); File dir = outputFile.getParentFile(); if (!dir.isDirectory() && !dir.mkdirs()) { throw new MojoExecutionException("Could not create directory for features file: " + dir); getLog().info("Generation not enabled"); getLog().info("Attaching artifact"); Artifact artifact = factory.createArtifactWithClassifier(project.getGroupId(), project.getArtifactId(), project.getVersion(), attachmentArtifactType, attachmentArtifactClassifier); artifact.setFile(outputFile); project.setArtifact(artifact); return; writeFeatures(out); getLog().info("Attaching features XML"); projectHelper.attachArtifact(project, attachmentArtifactType, attachmentArtifactClassifier, outputFile); } else { throw new MojoExecutionException("Could not create directory for features file: " + dir); getLog().error(e.getMessage()); throw new MojoExecutionException("Unable to create features.xml file: " + e, e);
public void execute() throws MojoExecutionException, MojoFailureException { File featuresFileResolved = resolveFile(featuresFile); String groupId = project.getGroupId(); String artifactId = project.getArtifactId(); String version = project.getVersion(); if (artifactTemp.getGroupId() != null) groupId = artifactTemp.getGroupId(); if (artifactTemp.getArtifactHandler() != null) artifactId = artifactTemp.getArtifactId(); if (artifactTemp.getVersion() != null) if (classifier == null && !this.getProject().getPackaging().equals("kar")) { this.getLog().warn("Your project should use the \"kar\" packaging or configure a \"classifier\" for kar attachment"); projectHelper.attachArtifact(getProject(), "kar", null, archive); return; projectHelper.attachArtifact(getProject(), "kar", classifier, archive); } else { getProject().getArtifact().setFile(archive);
@Override protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException { FileWriter fw = null; try { this.outputFile.getParentFile().mkdirs(); fw = new FileWriter(outputFile); writer.write(fw, getInitializedBundleList()); projectHelper.attachArtifact(project, AttachPartialBundleListMojo.TYPE, AttachPartialBundleListMojo.CLASSIFIER, outputFile); } catch (IOException e) { throw new MojoExecutionException("Unable to output effective bundle list", e); } finally { if (fw != null) { try { fw.close(); } catch (IOException e) { } } } this.getLog().info("Attaching bundle list configuration"); try { this.attachConfigurations(); } catch (final IOException ioe) { throw new MojoExecutionException("Unable to attach configuration.", ioe); } catch (final ArchiverException ioe) { throw new MojoExecutionException("Unable to attach configuration.", ioe); } }
try { if (outputFile==null) outputFile = new File(getProject().getBasedir(),"target/"+getProject().getArtifactId()+".war"); File war = getJenkinsWarArtifact().getFile(); rezip.addZipfileset(z); getProject().setArtifacts(resolveDependencies(dependencyResolution)); .map(a -> { getLog().debug("This plugin " + a + "to be added to custom war"); return projectArtifacts; // have to return someting from multiline lambda inside map() }); artifactResolver.resolve(hpi,getProject().getRemoteArtifactRepositories(), localRepository); if (hpi.getFile().isDirectory()) throw new UnsupportedOperationException(hpi.getFile()+" is a directory and not packaged yet. this isn't supported"); getLog().info("Generated "+outputFile); projectHelper.attachArtifact(getProject(), "war", outputFile); } catch (IOException e) { throw new MojoExecutionException("Failed to package war",e); } catch (AbstractArtifactResolutionException e) { throw new MojoExecutionException("Failed to package war",e);
@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); }
@SuppressWarnings("deprecation") private void archive(String type) throws IOException { Artifact artifact1 = factory.createArtifactWithClassifier(project.getArtifact().getGroupId(), project.getArtifact().getArtifactId(), project.getArtifact().getVersion(), type, "bin"); File target1 = archive(targetServerDirectory, destDir, artifact1); // artifact1 is created with explicit classifier "bin", which is dropped below when attachArtifact is called // which means we can't use artifact1.equals(artifact) directly with artifact1 Artifact artifact2 = factory.createArtifact(artifact1.getGroupId(), artifact1.getArtifactId(), artifact1.getVersion(), artifact1.getScope(), artifact1.getType()); for (Artifact artifact : project.getAttachedArtifacts()) { if (artifact2.equals(artifact)) { getLog().debug("Artifact " + artifact2 + " already attached"); return; } } if (attach) { projectHelper.attachArtifact(project, artifact1.getType(), classifier, target1); } if (!project.getPackaging().equals("pom")) { artifact2.setFile(target1); project.setArtifact(artifact2); } }
throw new MojoExecutionException( "Cannot create proguard output directory" ); throw new MojoExecutionException( "Non-directory exists at " + proguardDir.getAbsolutePath() ); getLog().info( "Proguarding output" ); CommandExecutor executor = CommandExecutor.Factory.createDefaultCommmandExecutor(); executor.setLogger( this.getLog() ); getLog().debug( javaExecutable + " " + commands.toString() + proguardCommands.toString() ); executor.executeCommand( javaExecutable, commands, project.getBasedir(), false ); throw new MojoExecutionException( "", e ); projectHelper.attachArtifact( project, "map", mapFile );
getLog().info( "Skipping RSL creation" ); return; getLog().debug( "project.getPackaging = " + packaging ); if ( project.getArtifact().getFile() == null ) getLog().warn( "Skipping RSL creator, no SWC attached to this project." ); return; throw new MojoExecutionException( e.getMessage(), e ); getLog().debug( "attaching Artifact " ); projectHelper.attachArtifact( project, SWF, new File( getOutput() ) );
getLog().info("Cataloging Artifacts for promotion & reattachment: " + project.getBuild().getDirectory()); File catalog = new File(buildDirectory, project.getArtifact().getArtifactId() + ".txt"); getLog().debug("Failed to remove catalog file: " + catalog); getLog().debug("Failed to create build directory: " + buildDirectory); if (hasFile(project.getArtifact())) { catalogArtifact(writer, project.getArtifact()); } else { getLog().info("Attaching catalog artifact: " + catalog); projectHelper.attachArtifact(project, "txt", "catalog", catalog); } catch (IOException ioe) { throw new MojoExecutionException("Failed to create catalog of artifacts", ioe); } finally { if (writer != null) {
if ( ! SUPPORTED_PACKAGING_TYPES.contains( project.getPackaging() ) ) getLog().info( "Skipping zipalign on " + project.getPackaging() ); return; parsedOutputApk = FilenameUtils.separatorsToSystem( parsedOutputApk ); getLog().debug( "skip:" + parsedSkip ); getLog().debug( "verbose:" + parsedVerbose ); getLog().debug( "inputApk:" + parsedInputApk ); getLog().debug( "outputApk:" + parsedOutputApk ); projectHelper.attachArtifact( project, APK, parsedClassifier, new File( outputApk ) ); getLog().info( "Attach " + getFullPathWithName( outputApk ) + " as '" + parsedClassifier + "' to the project" ); throw new MojoExecutionException( "", e );
public void execute() throws MojoExecutionException { try { String packageName = project.getArtifactId()+"-"+project.getVersion()+"-"+sourceClassifier; File packageFile = new File(new File(project.getBuild().getDirectory()), packageName+".zip"); // Verify the the configure script got generated before packaging. File configure = new File(packageDirectory, "configure"); if( !skipAutogen && !configure.exists() ) { // Looks like this platform could not generate the // configure script. So don't install deploy // partially created source package. getLog().info(""); getLog().warn("Will NOT package the native sources to: "+packageFile); getLog().info(" Native source build directory did not contain a 'configure' script."); getLog().info(" To ignore this warning and package it up anyways, configure the plugin with: <skipAutogen>true</skipAutogen>"); getLog().info(""); return; } Archiver archiver = archiverManager.getArchiver( "zip" ); archiver.setDestFile( packageFile); archiver.setIncludeEmptyDirs(true); archiver.addDirectory(packageDirectory, packageName+"/"); archiver.createArchive(); projectHelper.attachArtifact( project, "zip", sourceClassifier, packageFile ); } catch (Exception e) { throw new MojoExecutionException("packageing failed: "+e, e); } }
protected void packageSources( List projects ) throws MojoExecutionException if ( project.getArtifact().hasClassifier() ) getLog().warn( "NOT adding sources to artifacts with classifier as Maven only supports one classifier " + "per artifact. Current artifact [" + project.getArtifact().getId() + "] has a [" + project.getArtifact().getClassifier() + "] classifier." ); getLog().info( "Adding existing MANIFEST to archive. Found under: " + defaultManifestFile.getPath() ); archive.setManifestFile( defaultManifestFile ); if (!archive.isForced()) { getLog().warn( "ignoring unsupported archive forced = false parameter." ); archive.setForced( true ); throw new MojoExecutionException( "Error creating source archive: " + e.getMessage(), e ); throw new MojoExecutionException( "Error creating source archive: " + e.getMessage(), e ); throw new MojoExecutionException( "Error creating source archive: " + e.getMessage(), e ); projectHelper.attachArtifact( project, getType(), getClassifier(), outputFile );
name = "application"; outputFile = (project.getBuild().getDirectory() + "/generated/wadl/" + name + "." + outputFileExtension).replace("/", File.separator); throw new MojoExecutionException(e.getMessage(), e); } finally { try { throw new MojoExecutionException(e.getMessage(), e); if (wadlFile.exists()) { if (classifier != null) { projectHelper.attachArtifact(project, "wadl", classifier, wadlFile); } else { projectHelper.attachArtifact(project, "wadl", wadlFile);
public void execute() throws MojoExecutionException if ( pomPackagingOnly && !"pom".equals( project.getPackaging() ) ) getLog().info( "Skipping because packaging '" + project.getPackaging() + "' is not pom." ); return; String filename = project.getArtifactId() + "-" + project.getVersion() + "-" + descriptorFile.getName(); File targetDescriptorFile = new File( project.getBuild().getDirectory(), filename ); getLog().info( "Attaching '" + PathTool.getRelativeFilePath( basedir.getAbsolutePath(), descriptorFile.getAbsolutePath() ) + "' site descriptor with classifier '" + classifier + "'." ); projectHelper.attachArtifact( project, "xml", classifier, targetDescriptorFile ); throw new MojoExecutionException( "Unable to copy site descriptor", e ); getLog().info( "No site descriptor found: nothing to attach." );
String xprojZipFileName = project.getArtifactId() + "-" + XCODEPROJ_WITH_DEPS_CLASSIFIER + ".zip"; final String projectBuildDirectory = project.getBuild().getDirectory(); String relativeTargetDirName = FileUtils.getRelativePath(projectBuildDirectory, project.getBasedir() .getAbsolutePath(), "/"); String relativeSrcDirName = FileUtils.getRelativePath(FolderLayout.getSourceFolder(project).getAbsolutePath(), getLog().info("Packaged the Xcode project with all its dependencies into the zip file " + xprojZipFileName); throw new MojoExecutionException( "Could not package the Xcode project with all its dependencies into a zip file.", e); projectHelper.attachArtifact(project, "zip", XCODEPROJ_WITH_DEPS_CLASSIFIER, new File(projectBuildDirectory, xprojZipFileName));
getLog().debug( "DexMechanism set to " + parsedDexMechanism ); if ( parsedDexMechanism != DexMechanism.D8 ) getLog().info( "Not executing D8Mojo because DexMechanism set to " + parsedDexMechanism ); return; projectHelper.attachArtifact( project, "jar", project.getArtifact().getClassifier(), jarFile ); projectHelper.attachArtifact( project, "apksources", apksources );
if (artifact.getArtifactId().equalsIgnoreCase("summer-onejar")) { artifact.updateVersion(artifact.getVersion(), localRepository); putEntry(out, new FileInputStream(artifact.getFile()), new ZipEntry(JAR_CLASSPATH + artifact.getFile().getName())); MavenProject project = mavenProjectBuilder.buildFromRepository(artifact, remoteArtifactRepositories, localRepository); List<Dependency> dependencies = project.getDependencies(); for (Dependency dependency : dependencies) { if (!"provided".equals(dependency.getScope())) { projectHelper.attachArtifact(project, "jar", jarFile); getLog().error(e.getMessage(), e); throw new MojoExecutionException(e.getMessage(), e); } finally { IOUtils.closeQuietly(out);