karaf-maven-plugin: make collection filter-by-scope configurable
----------------------------------------------------------------

                 Key: KARAF-1200
                 URL: https://issues.apache.org/jira/browse/KARAF-1200
             Project: Karaf
          Issue Type: Bug
          Components: karaf-tooling
    Affects Versions: 3.0.0
         Environment: maven 3.0.4
            Reporter: Andrei Pozolotin


1) current karaf-maven-plugin 3.0.0-SNAPSHOT collects artifacts from all maven 
scopes;

2) this is due to custom ScopeDependencySelector here:

https://svn.apache.org/repos/asf/karaf/trunk/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/DependencyHelper.java

3) workaround: use standrd ather ScopeDependencySelector with scope list, such 
as:

        private DependencyNode getDependencyTree(final Artifact artifact)
                        throws MojoExecutionException {

                try {

                        final CollectRequest collectRequest = new 
CollectRequest(
                                        new Dependency(artifact, "compile"), 
null, projectRepos);

                        final DefaultRepositorySystemSession session = new 
DefaultRepositorySystemSession(
                                        repoSession);

                        session.setDependencySelector(new AndDependencySelector(
                                        new OptionalDependencySelector(),
                                        new ScopeDependencySelector("test", 
"provided", "system"),
                                        new ExclusionDependencySelector()));


4) proper solution: expose filtering scope list as plugin config parameter;


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to