org.universAAL.maven.treebuilder
Class ExecutionListCreator

Package class diagram package ExecutionListCreator
java.lang.Object
  extended by org.universAAL.maven.treebuilder.ExecutionListCreator

public class ExecutionListCreator
extends Object

This class provides creation of OSGi bundles execution list on basis of list of maven artifacts. Basically, if there is a need to launch given set of maven artifacts (they assumed to be OSGi bundles) in OSGi congainer, the class resolves all their dependencies and prepares execution list of bundles (in a proper order) which have to be launched to have these maven artifacts working. It aggregates DependencyTreeBuilder and on top of it adds functionality of flattening dependency tree into an artifact list sorted in the execution order. All artifacts of execution list are resolved and downloaded to the local maven repository.

Author:
rotgier

Constructor Summary
ExecutionListCreator(org.apache.maven.plugin.logging.Log log, org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource, org.apache.maven.artifact.factory.ArtifactFactory artifactFactory, org.apache.maven.project.MavenProjectBuilder mavenProjectBuilder, org.apache.maven.artifact.repository.ArtifactRepository localRepository, List remoteRepositories, org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver, String throwExceptionOnConflictStr, StartSpec[] startSpecs)
           
 
Method Summary
 List createArtifactExecutionList(org.apache.maven.project.MavenProject mavenProject, Set<String> separatedArtifactDepsOfRootMvnUrls, boolean includeTestRuntimes)
          Creates execution list for given MavenProject.
 List createArtifactExecutionList(String[] provisions, boolean defaultTransitive, boolean includeTestRuntimes)
          Creates execution list on basis of provisions list and parameter specifying default transitiveness.
 org.apache.maven.artifact.Artifact parseMvnUrlWithType(String mvnurl)
          Parses mvn url which has to be in the following format: mvn:/groupId/artifactId/version/type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutionListCreator

public ExecutionListCreator(org.apache.maven.plugin.logging.Log log,
                            org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource,
                            org.apache.maven.artifact.factory.ArtifactFactory artifactFactory,
                            org.apache.maven.project.MavenProjectBuilder mavenProjectBuilder,
                            org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                            List remoteRepositories,
                            org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver,
                            String throwExceptionOnConflictStr,
                            StartSpec[] startSpecs)
Method Detail

parseMvnUrlWithType

public org.apache.maven.artifact.Artifact parseMvnUrlWithType(String mvnurl)
Parses mvn url which has to be in the following format: mvn:/groupId/artifactId/version/type.

Parameters:
mvnurl -
Returns:
returns maven artifact which corresponds to the provided mvnurl.

createArtifactExecutionList

public List createArtifactExecutionList(org.apache.maven.project.MavenProject mavenProject,
                                        Set<String> separatedArtifactDepsOfRootMvnUrls,
                                        boolean includeTestRuntimes)
                                 throws Exception
Creates execution list for given MavenProject.

Parameters:
mavenProject -
Returns:
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
Exception

createArtifactExecutionList

public List createArtifactExecutionList(String[] provisions,
                                        boolean defaultTransitive,
                                        boolean includeTestRuntimes)
                                 throws Exception
Creates execution list on basis of provisions list and parameter specifying default transitiveness.

Parameters:
provisions - list of provision strings. Each provision string has to have the following format: (nontransitive|transitive)?mvn:/groupId/artifactId/version. Information at the beginning: "transitive", "nontransitive" is optional. If it is present it overrides the defaultTransitive parameter but only for given provision string.
defaultTransitive - default value of transitive parameter for all provision strings. If transitive is true then artifact related to each provision string is recursively resolved and all its regular and uAAL-Runtime maven dependencies are included in returned artifact list. If transitive is false then only artifacts (related to provision strings) themselves are resolved without looking at their dependencies. Thanks to that, providing explicit list of artifact to be launched is possible.
Returns:
execution list - list of strings representing mvnUrls of bundles which should be launched
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
Exception


Copyright © 2014 universAAL Consortium. All Rights Reserved.