Refine search
libraryJars.add( createProguardInput( rtJar.getPath() ) ); if ( jsseJar != null ) libraryJars.add( createProguardInput( jsseJar.getPath() ) ); if ( jceJar != null ) libraryJars.add( createProguardInput( jceJar.getPath() ) ); if ( artifact.getArtifactId().equals( "android" ) && parsedIncludeJdkLibs ) libraryJars.add( createProguardInput( artifact.getFile().getAbsolutePath(), ANDROID_LIBRARY_EXCLUDED_FILTER ) ); libraryJars.add( createProguardInput( artifact.getFile().getAbsolutePath() ) ); libraryJars.add( createProguardInput( artifact.getFile().getAbsolutePath() ) );
@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 ( projectOutputDirectory.exists() || !getJack().isEnabled() ) computeDuplicateFiles( artifact.getFile() ); getLog().warn( "Cannot compute duplicates files from " + artifact.getFile().getAbsolutePath(), e ); jarFiles.add( artifact.getFile() ); final File innerJar = new File( jarFile, filename ); getLog().debug( "Adding resources from innerJar : " + innerJar ); apkBuilder.addResourcesFromJar( innerJar );
private Map<String,String> configureTranslatedUrls() { Map<String, String> urls = new HashMap<>(); List<Artifact> artifacts = new ArrayList<>(project.getAttachedArtifacts()); artifacts.add(project.getArtifact()); for (Artifact artifact : artifacts) { if (artifact.getFile() != null && artifact.getFile().exists()) { String mvnUrl = artifactToMvn(artifact); urls.put(mvnUrl, artifact.getFile().toURI().toString()); } } urls.putAll(translatedUrls); return urls; }
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; }
appcp.add(new File(buildOutputDirectory)); if (!"pom".equals(artifact.getType())) { appcp.add(new File(artifact.getFile().getAbsolutePath())); watchDirs.add(mavenProject.getBasedir()); watchDirs.addAll(refbasedir); if (this.watchDirs != null) { this.watchDirs.forEach(f -> watchDirs.add(new File(f))); cmds.add(runapp);
public CacheKey( Artifact artifact, boolean resolveManagedVersions, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories ) { File file = artifact.getFile(); this.artifact = ArtifactUtils.copyArtifact( artifact ); if ( "pom".equals( artifact.getType() ) && file != null ) { pomHash = file.getPath().hashCode() + file.lastModified(); } else { pomHash = 0; } this.resolveManagedVersions = resolveManagedVersions; this.repositories.add( localRepository ); this.repositories.addAll( remoteRepositories ); int hash = 17; hash = hash * 31 + artifactHashCode( artifact ); hash = hash * 31 + ( resolveManagedVersions ? 1 : 2 ); hash = hash * 31 + repositoriesHashCode( repositories ); this.hashCode = hash; }
/** * Unpack the artifact and add the extraction path to the list of packagePaths, return the extraction path. * If a pkg file is present as a sibling file of the jar file, it is preferred, otherwise the jar file is used. */ File unpackPkg(Artifact artifact, File remotePackagesDir) throws MojoExecutionException { File jarFile = artifact.getFile(); String targetDirName = String.format("%s__%s__%s", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion()); File targetDir = new File(remotePackagesDir, targetDirName); unpackPkg(jarFile.exists() ? jarFile : jarFile, artifact, targetDir); return targetDir; }
File getTouchfile( Artifact artifact ) { StringBuilder sb = new StringBuilder( 128 ); sb.append( artifact.getArtifactId() ); sb.append( '-' ).append( artifact.getBaseVersion() ); if ( artifact.getClassifier() != null ) { sb.append( '-' ).append( artifact.getClassifier() ); } sb.append( '.' ).append( artifact.getType() ).append( LAST_UPDATE_TAG ); return new File( artifact.getFile().getParentFile(), sb.toString() ); }
} else { artifacts.add(repositorySystem.createArtifactWithClassifier(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), "sources")); ArtifactResolutionResult result = repositorySystem.resolve(request); for (Artifact resolvedArtifact : result.getArtifacts()) { if (resolvedArtifact.getFile() != null) { File file = resolvedArtifact.getFile(); if (!file.isDirectory()) { builder.addSourcesJar(file.getAbsolutePath()); builder.addSourcesDirectory(new File(sourceRoot).getAbsolutePath());
String refId = getProjectReferenceId( pluginArtifact.getGroupId(), pluginArtifact.getArtifactId(), pluginArtifact.getVersion() ); MavenProject ref = (MavenProject) getProjectReferences().get( refId ); if ( ref != null ) if ( ref.getArtifact().getFile() != null && ref.getArtifact().getFile().exists() ) if ( attached != null ) if ( attached.getFile() != null && attached.getFile().exists() )
public ReportOptions convert() { final List<String> classPath = new ArrayList<>(); try { classPath.addAll(this.mojo.getProject().getTestClasspathElements()); } catch (final DependencyResolutionRequiredException e1) { this.log.info(e1); } addOwnDependenciesToClassPath(classPath); classPath.addAll(this.mojo.getAdditionalClasspathElements()); for (Object artifact : this.mojo.getProject().getArtifacts()) { final Artifact dependency = (Artifact) artifact; if (this.mojo.getClasspathDependencyExcludes().contains( dependency.getGroupId() + ":" + dependency.getArtifactId())) { classPath.remove(dependency.getFile().getPath()); } } ReportOptions option = parseReportOptions(classPath); return updateFromSurefire(option); }
for ( Artifact artifact : pluginDependencies ) getLog().debug( "pluginArtifact: " + artifact.getFile() ); if ( ( "proguard".equals( artifact.getArtifactId() ) ) || ( "proguard-base" .equals( artifact.getArtifactId() ) ) ) getLog().debug( "proguardArtifact: " + proguardArtifact.getFile() ); return proguardArtifact.getFile().getAbsoluteFile().toString();
plugin.setArtifactId( extension.getArtifactId() ); plugin.setVersion( extension.getVersion() ); extensionPlugins.add( plugin ); extensionPlugins.add( plugin ); final List<Artifact> artifacts = recordRealm.getArtifacts(); extensionRealms.add( extensionRealm ); if ( extensionDescriptor != null ) if ( !plugin.isExtensions() && artifacts.size() == 2 && artifacts.get( 0 ).getFile() != null && "plexus-utils".equals( artifacts.get( 1 ).getArtifactId() ) )
if ( !schemaSourceDirectory.exists() ) { getLog().error( schemaSourceDirectory.getAbsolutePath() + " does not exist" ); return null; if ( !schemaLocation.exists() ) { artifacts.add( artifactFactory.createArtifact( "org.geotools", "gt2-xml-gml2", "2.7-SNAPSHOT", "compile", "jar" artifacts.add( artifactFactory.createArtifact( "org.geotools", "gt2-xml-gml3", "2.7-SNAPSHOT", "compile", "jar" artifacts.add( artifactFactory.createArtifact( "org.geotools", "gt2-xml-filter", "2.7-SNAPSHOT", "compile", "jar" urls.add( resolvedArtifact.getFile().toURI().toURL() ); File file = new File( schemaLocation ); if ( file.exists() ) { getLog().debug( "Resolving " + schemaLocation + " to " + schemaLocation ); String fileName = new File( schemaLocation ).getName();