zregvart edited a comment on issue #5: [MCHECKSTYLE-353] - Don't resolve any 
dependencies
URL: 
https://github.com/apache/maven-checkstyle-plugin/pull/5#issuecomment-480211964
 
 
   @eolivelli I made my tests, here's what I've found:
   
   To prepare for the tests:
   
    1. installed the maven-checkstyle-plugin to an empty directory that will 
serve as a local Maven repository (`/tmp/no-dep`):
   
           $ git clone https://github.com/zregvart/maven-checkstyle-plugin.git
           $ cd maven-checkstyle-plugin
           $ git checkout no-dep # this PR
           $ mvn install -Dmaven.repo.local=/tmp/no-dep
   
    1. cloned the apache-camel git repository:
   
           $ git clone https://gitbox.apache.org/repos/asf/camel.git
           $ cd camel
   
    1. to run with `3.0.1-SNAPSHOT` the version from this PR, I've changed 
`parent/pom.xml` `maven-checkstyle-plugin-version` property to `3.0.1-SNAPSHOT` 
and ran:
   
           ./mvnw -Dmaven.repo.local=/tmp/no-dep -DskipSpringBootStarters 
-Psourcecheck checkstyle:check
   
    1. with the change to require only compile dependencies 
(`requiresDependencyResolution = ResolutionScope.COMPILE`), I've built and 
installed the maven-checkstyle-plugin to a different local Maven repository 
(`/tmp/with-compile`) and changed the `paremt/pom.xml` as above, and ran:
   
           ./mvnw -Dmaven.repo.local=/tmp/with-compile -DskipSpringBootStarters 
-Psourcecheck checkstyle:check
   
    1. to run with the `3.0.0` released version that requires dependency 
resolution I made sure that `parent/pom.xml` `maven-checkstyle-plugin-version` 
property is set to `3.0.0` and ran:
   
           ./mvnw -Dmaven.repo.local=/tmp/dep -DskipSpringBootStarters 
-Psourcecheck checkstyle:check
   
   The only difference is the different local Maven repository (`/tmp/dep` and 
`/tmp/no-dep`) and the maven-checkstyle-plugin version (released, and from this 
PR)
   
   In both cases 522 Maven modules are built, without -DskipSpringBootStarters 
this number rises to 800.
   
   These are the results:
   
   Without dependencies (3.0.0-SNAPSHOT with PR #5):
    - takes 01:51 min
    - local Maven repository size 102MB (103944 kB)
   
   
   Without dependency requirement set to `COMPILE` (3.0.0-SNAPSHOT with PR #5 
and the change `requiresDependencyResolution = ResolutionScope.COMPILE`):
    - takes 11:14 min
    - local Maven repository size 1.3GB (1271076 kB)
    - the build fails in one of the examples as it tries to download an 
artefact that is not present in the reactor (the build is not executing 
`package` or `install` phase) and not installed in the local repository, but is 
not required to run checkstyle as demonstrated by the build without 
dependencies that succeeded.
   
   With dependencies (3.0.0):
    - takes 12:46 min
    - local Maven repository size 1.7GB (1700456 kB)
    - the build fails in one of the examples same as the previous.
   
   With that my conclusion is that not only that the dependency resolution 
increases the build time simply by downloading 1.6GB of dependencies, but it 
can also fail the build if we don't previously install all the dependencies 
from the project or make them available in a remote Maven repository.
   
   The 7x difference in execution time simply comes from the fact that unused 
dependencies are downloaded.
   
   I still maintain and I argue the point that any dependency needed by the 
maven-checkstyle-plugin should not be put in the main `<dependencies>` section 
of the POM and should be declared in the `<dependencies>` section of the plugin.
   
   If you think that this might break backward compatibility I'm happy to have 
this included in a non-patch release.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to