/** * Returns true if the artifact matches <i>all</i> match policies, otherwise returns false. * * @param artifact the artifact to match against the match policies * @param matchPolicies the match policies * @return true if the artifact matches <i>all</i> match policies, otherwise returns false */ private boolean matchArtifacts( Artifact artifact, List<ArtifactMatchPolicy> matchPolicies ) { for ( ArtifactMatchPolicy matchPolicy : matchPolicies ) { if ( !matchPolicy.match( artifact ) ) { return false; } } return true; }
/** * Return true is the specified net dependency matches ALL of the specified match policies, otherwise returns false. * * @param netDependency the net dependency to match * @param matchPolicies the match policies to use in matching the net dependency * @return true is the specified net dependency matches ALL of the specified match policies, otherwise returns false */ private boolean isMatch( NetDependency netDependency, List<NetDependencyMatchPolicy> matchPolicies ) { for ( NetDependencyMatchPolicy matchPolicy : matchPolicies ) { if ( !matchPolicy.match( netDependency ) ) { return false; } } return true; }
/** * @see ArtifactContext#init(org.apache.maven.project.MavenProject,java.util.List, File) */ public void init( MavenProject mavenProject, List<ArtifactRepository> remoteArtifactRepositories, File localRepository ) { this.project = mavenProject; this.localRepository = localRepository.getAbsolutePath(); artifactInstaller.init( this, remoteArtifactRepositories, localRepository ); }
"net-dependencies" ); artifactContext.init( null, mavenProject.getRemoteArtifactRepositories(), new File( localRepository ) ); Map<String, ArtifactHandler> map = new HashMap<String, ArtifactHandler>(); artifactContext.getArtifactInstaller().resolveAndInstallNetDependenciesForProfile( "VisualStudio2005", null, null ); throw new MojoExecutionException( e.getMessage(), e ); List<Dependency> gacInstallDependencies = netRepository.getDependenciesFor( gacInstallPolicies ); for ( Dependency dependency : gacInstallDependencies ) List<Artifact> artifacts = artifactContext.getArtifactsFor( dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(), dependency.getType() );
assemblyResolver.resolveTransitivelyFor( project, project.getDependencies(), project.getRemoteArtifactRepositories(), localRepository, true ); throw new MojoExecutionException( e.getMessage() );
assemblyResolver.resolveTransitivelyFor(new MavenProject(), Collections.singletonList(dependency), getMavenProject().getRemoteArtifactRepositories(), localRepository, false); throw new MojoExecutionException( e.getMessage(), e ); sourceArtifactDependencies.add(ProjectFactory.createDependencyFrom(projectDependency)); artifactContext.getArtifactInstaller().installArtifactAndDependenciesIntoPrivateApplicationBase(localRepository, artifact, sourceArtifactDependencies); dao.closeConnection();
(NetDependenciesRepository) repositoryRegistry.find( "net-dependencies" ); List<NetDependencyMatchPolicy> matchPolicies = new ArrayList<NetDependencyMatchPolicy>(); matchPolicies.add( new ProfileMatchPolicy( profile ) ); netDependencies.addAll( repository.getDependenciesFor( matchPolicies ) ); assemblyResolver.resolveTransitivelyFor( new MavenProject(), netDependencies, remoteArtifactRepositories, localRepository, false ); matchPolicies.add( new ProfileMatchPolicy( profile ) ); matchPolicies.add( new ExecutableAndNetPluginAndAddinMatchPolicy() ); throw new NPandayArtifactResolutionException( "NPANDAY-001-001: Problem resolving artifact for java binding: Message = " + e.getMessage(), e ); throw new NPandayArtifactResolutionException( "NPANDAY-001-002: Could not find artifact for java binding: Message =" + e.getMessage(), e ); throw new NPandayArtifactResolutionException( "NPANDAY-001-003: Problem resolving java dependency artifact: Message = " + e.getMessage(), e ); throw new NPandayArtifactResolutionException( "NPANDAY-001-004: Could not find java dependency artifact: Message = " + e.getMessage(), e );
public Artifact getArtifactFor(String groupId, String artifactId) throws PlatformUnsupportedException { List<Artifact> artifacts = artifactContext.getArtifactsFor( groupId, artifactId, null, null ); if ( artifacts.size() == 0 ) { throw new PlatformUnsupportedException( "NPANDAY-066-023: Could not locate the plugin - missing entry in the net-dependencies.xml file: GroupId = " + groupId + ", ArtifactId = " + artifactId ); } Artifact artifact = artifacts.get( 0 ); if ( artifact == null ) { throw new PlatformUnsupportedException( "NPANDAY-066-021: Could not locate the plugin: GroupId = " + groupId + ", ArtifactId = " + artifactId ); } return artifact; }
public void execute() throws MojoExecutionException, MojoFailureException { if ( localRepository == null ) { localRepository = new File( System.getProperty( "user.home" ), ".m2/repository" ); } org.openrdf.repository.Repository rdfRepository = new SailRepository( new MemoryStore( localRepository ) ); try { rdfRepository.initialize(); } catch ( RepositoryException e ) { throw new MojoExecutionException( "NPANDAY-1700-007: Message = " + e.getMessage() ); } artifactContext.init( project, project.getRemoteArtifactRepositories(), localRepository ); List<Dependency> netDependencies = new ArrayList<Dependency>(); for ( Dependency dependency : (List<Dependency>) project.getDependencies() ) { netDependencies.add( dependency ); } assemblyRepository( netDependencies, new DefaultRepositoryLayout() ); }
ApplicationConfig applicationConfig = artifactContext.getApplicationConfigFor( artifact ); File configExeFile = applicationConfig.getConfigBuildPath(); logger.debug( "NPANDAY-001-032: config file:" + configExeFile);
/** * @see ArtifactContext#getApplicationConfigFor(org.apache.maven.artifact.Artifact) */ public ApplicationConfig getApplicationConfigFor( Artifact artifact ) { return ApplicationConfig.Factory.createDefaultApplicationConfig( artifact, project.getBasedir(), new File( project.getBuild().getDirectory() ) ); }
/** * @see ArtifactContext#getNetModulesFor(org.apache.maven.artifact.Artifact) */ //TODO: support temporarily removed public List<Artifact> getNetModulesFor( Artifact artifact ) throws ArtifactException { if ( artifact == null ) { throw new ArtifactException( "NPANDAY-000-002: Cannot get .NET modules dependencies of a null artifact" ); } List<ArtifactMatchPolicy> matchPolicies = new ArrayList<ArtifactMatchPolicy>(); matchPolicies.add( new NetModuleMatchPolicy() ); return null; //return getDirectDependenciesFor( artifact, matchPolicies ); }
public List<Artifact> getDirectModuleDependencies() { List<Artifact> artifacts; try { artifacts = artifactContext.getNetModulesFor( project.getArtifact() ); } catch ( ArtifactException e ) { logger.error( "NPANDAY-061-000: Improper Initialization of the Net Modules", e ); return new ArrayList<Artifact>(); //TODO: How to handle this: usually implies improper init of ArtifactContext } if ( config.isTestCompile() && ArtifactTypeHelper.isDotnetModule( config.getArtifactType() ) ) { artifacts.add( project.getArtifact() ); } if ( config.isTestCompile() && ArtifactTypeHelper.isDotnetModule( project.getArtifact().getType() ) && project.getArtifact().getFile() != null && project.getArtifact().getFile().exists() ) { artifacts.add( project.getArtifact() ); } return artifacts; }
throw new NPandayArtifactResolutionException( "NPANDAY-089-000: " + e.getMessage(), e );
artifactContext.init( project, project.getRemoteArtifactRepositories(), localRepository ); if ( !new File( localRepository, "npanday.artifacts.resolved" ).exists() ) //performance optimization artifactContext.getArtifactInstaller().resolveAndInstallNetDependenciesForProfile( profile, dependencies, null ); throw new MojoExecutionException( e.getMessage(), e ); List<Dependency> gacInstallDependencies = repository.getDependenciesFor( gacInstallPolicies ); for ( Dependency dependency : gacInstallDependencies ) List<Artifact> artifacts = artifactContext.getArtifactsFor( dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(),
assemblyResolver.resolveTransitivelyFor( project, project.getDependencies(), project.getRemoteArtifactRepositories(), localRepository, true ); throw new MojoExecutionException( e.getMessage() );
public NetExecutable getPluginLoaderFor(Artifact artifact, VendorInfo vendorInfo, String localRepository, File parameterFile, String mojoName) throws PlatformUnsupportedException { //AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout(); File artifactPath = PathUtil.getPrivateApplicationBaseFileFor( artifact, new File( localRepository ) ); List<String> commands = new ArrayList<String>(); commands.add( "parameterFile=" + parameterFile.getAbsolutePath() ); commands.add( "assemblyFile=" + artifactPath.getAbsolutePath() ); commands.add( "mojoName=" + mojoName );//ArtifactId = namespace Artifact pluginLoaderArtifact = artifactContext.getArtifactsFor( "org.apache.npanday.plugins", "NPanday.Plugin.Loader", null, null ).get( 0 ); artifactPath = PathUtil.getPrivateApplicationBaseFileFor( pluginLoaderArtifact, new File( localRepository ) ); commands.add( "startProcessAssembly=" + artifactPath.getAbsolutePath() ); return getNetExecutableFromRepository( "org.apache.npanday.plugins", "NPanday.Plugin.Runner", vendorInfo, new File( localRepository ), commands, false ); }
ApplicationConfig config = ApplicationConfig.Factory.createDefaultApplicationConfig( project.getArtifact(), project.getBasedir(), new File(
assemblyResolver.resolveTransitivelyFor( project, aggregateDependencies, project.getRemoteArtifactRepositories(), localRepository, true ); throw new MojoExecutionException( e.getMessage() );
assemblyResolver.resolveTransitivelyFor( project, dependencies, project.getRemoteArtifactRepositories(), localRepository, true ); throw new MojoExecutionException( "NPANDAY-1700-010: Message = " + e.getMessage(), e );