You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Ismaël Mejía (JIRA)" <ji...@apache.org> on 2017/05/02 09:56:04 UTC

[jira] [Commented] (BEAM-1984) Enable dependency analysis of non-compile dependencies

    [ https://issues.apache.org/jira/browse/BEAM-1984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15992660#comment-15992660 ] 

Ismaël Mejía commented on BEAM-1984:
------------------------------------

I just updated the ticket description for more context on the issue.

The real question and a deeper problem is that we can enable this validation so the dependency plugin complains about all the test/runtime dependencies, this is a good idea because we will be more precise about dependencies, but it has a not so good tradeoff, we need to build exclusion lists, the problem is that once a jar is moved, it should be also removed from the exclusion list, but this is up to the person who moves the jar out, and I have not found an automatic way to detect this, so I am afraid that the solution is worse than the sickness. I will do a subsequent PR to show you this in detail so you tell me what you think.

{code}
            <configuration>
              <ignoredUnusedDeclaredDependencies>
                <ignoredUnusedDeclaredDependency>com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar</ignoredUnusedDeclaredDependency>
              </ignoredUnusedDeclaredDependencies>
            </configuration>
{code}

> Enable dependency analysis of non-compile dependencies
> ------------------------------------------------------
>
>                 Key: BEAM-1984
>                 URL: https://issues.apache.org/jira/browse/BEAM-1984
>             Project: Beam
>          Issue Type: Improvement
>          Components: build-system
>    Affects Versions: Not applicable
>            Reporter: Ismaël Mejía
>            Assignee: Ismaël Mejía
>            Priority: Minor
>
> In the Beam parent pom at this moment we have a configuration on the maven dependency plugin to ignore the verification of non-compile dependencies so unused or badly configured dependencies that are used only for test or runtime purposes are not reported.
> {code:xml}
>               <!-- Ignore runtime-only dependencies in analysis -->
>               <ignoreNonCompile>true</ignoreNonCompile>
> {code}
> I discovered this case when I executed:
> {code}
> 	mvn clean install -Dmaven.test.skip=true
> {code}
> Notice that this is really particular because this does not compile the tests classes, so it can detect when the ‘main’ classes are not using some code. This is different from the behavior of:
> {code}
> 	mvn clean install -DskipTests=true
> {code}
> That does not complain because skipTests compiles the tests.
> For the first case (maven.test.skip) I got a warning ‘Unused declared dependencies found’ so with this I discovered the test/runtime only dependencies that are not correctly scoped. I will do a PR to fix this, because we can get rid of compile dependencies that are test or runtime only.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)