public Object getKey() { return "project " + artifact.getGroupId() + ":" + artifact.getArtifactId(); }
public String toString() { return "project information for " + artifact.getArtifactId() + " " + artifact.getVersion(); }
private String getRelocationKey( Artifact artifact ) { return artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion(); }
private boolean matchesTarget( Artifact found ) { return found.getGroupId().equals( target.getGroupId() ) && found.getArtifactId().equals( target.getArtifactId() ) && found.getVersion().equals( target.getVersion() ) && found.getType().equals( target.getType() ) && classifierMatch( found.getClassifier(), target.getClassifier() ) ; }
private void copyNativeLibraryArtifact( Artifact artifact, File destinationDirectory, String ndkArchitecture ) throws MojoExecutionException { final File artifactFile = getArtifactResolverHelper().resolveArtifactToFile( artifact ); try { final String artifactId = artifact.getArtifactId(); String filename = artifactId.startsWith( "lib" ) ? artifactId + ".so" : "lib" + artifactId + ".so"; if ( ndkFinalLibraryName != null && artifact.getFile().getName().startsWith( "lib" + ndkFinalLibraryName ) ) { // The artifact looks like one we built with the NDK in this module // preserve the name from the NDK build filename = artifact.getFile().getName(); } final File folder = new File( destinationDirectory, ndkArchitecture ); final File file = new File( folder, filename ); getLog().debug( "Copying native dependency " + artifactId + " (" + artifact.getGroupId() + ") to " + file ); FileUtils.copyFile( artifactFile, file ); } catch ( IOException e ) { throw new MojoExecutionException( "Could not copy native dependency.", e ); } }
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();
Artifact artifact = ( Artifact ) it.next(); File f = artifact.getFile(); throw new MojoExecutionException( "Cannot locate artifact file of " + artifact.getArtifactId() ); FileUtils.getFileNames( targetFolderFile, artifact.getArtifactId() + "-*.jar", null, false ); existing.get( 0 ).split( "(" + artifact.getArtifactId() + "-)" )[1].split( "(.jar)" )[0]; DefaultArtifactVersion existingVersion = new DefaultArtifactVersion( version ); DefaultArtifactVersion artifactVersion = new DefaultArtifactVersion( artifact.getVersion() ); LOG.info( "Artifact " + artifact.getArtifactId() + " with the same or higher " + "version already exists in lib folder, skipping copy" ); continue; throw new MojoExecutionException( "Error while copying artifact file of " + artifact.getArtifactId(), e );
artifactSet.getExcludes() ) ) if ( artifact.getType().equals( Const.ArtifactType.NATIVE_SYMBOL_OBJECT ) || artifact.getType().equals( Const.ArtifactType.NATIVE_IMPLEMENTATION_ARCHIVE ) ) else if ( artifact.getType().equals( APKLIB ) ) getLog().debug( "Extracting APK classes to target/classes : " + artifact.getArtifactId() ); final File apkClassesJar = getUnpackedLibHelper().getJarFileForApk( artifact ); getLog().debug( "Extracting APK : " + apkClassesJar + " to " + targetDirectory ); getLog().debug( "Adding dex input : " + artifact.getFile() ); inputs.add( artifact.getFile().getAbsoluteFile() );
if ( artifact.getFile() != null && !removeVersion ) destFileName = artifact.getFile().getName(); if ( !removeVersion ) versionString = "-" + artifact.getVersion(); if ( StringUtils.isNotEmpty( artifact.getClassifier() ) ) classifierString = "-" + artifact.getClassifier(); destFileName = artifact.getArtifactId() + versionString + classifierString + "." + artifact.getArtifactHandler().getExtension();
private ModelSource createStubModelSource( Artifact artifact ) { StringBuilder buffer = new StringBuilder( 1024 ); buffer.append( "<?xml version='1.0'?>" ); buffer.append( "<project>" ); buffer.append( "<modelVersion>4.0.0</modelVersion>" ); buffer.append( "<groupId>" ).append( artifact.getGroupId() ).append( "</groupId>" ); buffer.append( "<artifactId>" ).append( artifact.getArtifactId() ).append( "</artifactId>" ); buffer.append( "<version>" ).append( artifact.getBaseVersion() ).append( "</version>" ); buffer.append( "<packaging>" ).append( artifact.getType() ).append( "</packaging>" ); buffer.append( "</project>" ); return new StringModelSource( buffer, artifact.getId() ); }
public String pathOf( Artifact artifact ) { ArtifactHandler artifactHandler = artifact.getArtifactHandler(); StringBuilder path = new StringBuilder( 128 ); path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() ); if ( artifact.hasClassifier() ) { path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() ); } if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 ) { path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() ); } return path.toString(); }
final String type = artifact.getType(); if ( type.equals( APKLIB ) && !instrumentationTest ) getLog().info( "Extracting apklib " + artifact.getArtifactId() + "..." ); extractApklib( artifact ); getLog().info( "Extracting aar " + artifact.getArtifactId() + "..." ); extractAarLib( artifact ); getLog().info( "Extracting apk " + artifact.getArtifactId() + "..." ); extractApkClassesJar( artifact ); getLog().debug( "Not extracting " + artifact.getArtifactId() + "..." );
protected AbstractArtifactResolutionException( String message, Artifact artifact, List<ArtifactRepository> remoteRepositories, Throwable t ) { this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), remoteRepositories, artifact.getDependencyTrail(), t ); this.artifact = artifact; }
private String[] createDaemonClassPath() { Artifact toolArtifact = pluginArtifacts.stream() .filter(artifact -> artifact.getGroupId().equals("org.teavm") && artifact.getArtifactId().equals("teavm-tooling")) .findFirst() .orElse(null); if (toolArtifact == null) { return new String[0]; } ArtifactResolutionResult resolutionResult = repositorySystem.resolve(new ArtifactResolutionRequest() .setLocalRepository(localRepository) .setRemoteRepositories(new ArrayList<>(remoteRepositories)) .setResolveTransitively(true) .setResolveRoot(true) .setArtifact(toolArtifact)); if (!resolutionResult.isSuccess()) { return new String[0]; } return resolutionResult.getArtifacts().stream() .map(artifact -> artifact.getFile().getAbsolutePath()) .toArray(String[]::new); }
public static String key( Artifact artifact ) { return key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ); }
public Object getKey() { return "artifact " + artifact.getGroupId() + ":" + artifact.getArtifactId(); }
if ( artifact.getArtifactId().equals( "android" ) && parsedIncludeJdkLibs ) createProguardInput( artifact.getFile().getAbsolutePath(), ANDROID_LIBRARY_EXCLUDED_FILTER ) ); libraryJars.add( createProguardInput( artifact.getFile().getAbsolutePath() ) ); libraryJars.add( createProguardInput( artifact.getFile().getAbsolutePath() ) );
protected List<List<String>> makeDependencies(ScalaGenJsonMojo data) throws Exception { List<List<String>> back = new ArrayList<List<String>>(); @SuppressWarnings("unchecked") List<Artifact> deps = data.project.getCompileArtifacts(); for (Artifact dep : deps) { List<String> e = new ArrayList<String>(3); e.add(dep.getFile().getCanonicalPath()); e.add(dep.getArtifactId() + "/" + dep.getVersion()); back.add(e); } return back; }
private URL getDependencyURL(String name) throws MojoExecutionException { if (pluginDependencies != null && ! pluginDependencies.isEmpty()) { for (Iterator<Artifact> it = pluginDependencies.iterator(); it.hasNext();) { Artifact artifact = it.next(); if (artifact.getArtifactId().equals(name) && artifact.getType().equals("jar")) { return toURL(artifact.getFile()); } } } throw new MojoExecutionException("Dependency not found: " + name); }
getLog().debug( "Generating incomplete R file for apklib: " + apklibArtifact.getGroupId() + ":" + apklibArtifact.getArtifactId() ); final File apklibManifest = new File( unpackDir, "AndroidManifest.xml" ); final File apklibResDir = new File( unpackDir, "res" ); final String extension = dependency.getType(); final File dependencyResDir = getUnpackedLibResourceFolder( dependency ); if ( ( extension.equals( APKLIB ) || extension.equals( AAR ) ) && dependencyResDir.exists() ) final String extension = dependency.getType(); final File dependencyAssetsDir = getUnpackedLibAssetsFolder( dependency ); if ( ( extension.equals( APKLIB ) || extension.equals( AAR ) ) )