Switch to using no-AOP guice distribution

Gerrit and transitive dependencies don't use Guice AOP feature. Yet the
default Guice distribution shades cglib and asm libraries to support it.

This complicates the support for newer JDK versions, as the asm and the
Guice library must be upgraded to use newer byte code manipulation
libraries. This is especially a challenge when a new major Java version
is popping up every 6 months.

Given that Guice project already provides distribution without shaded
cglib and asm library: guice-x.y.z-classes.jar and even the one without
AOP feature altogether: guice-x.y.z-no_aop.jar, we can switch to using
the stripped Guice distribution.

Another advantage of using no-AOP Guice distribution, is that it is not
suffering from illegal reflective access warning: [1].

The public Guice's documentation mentions some advantages as for why
the Guice's AOP flavour should be used even in applications that don't
use method interceptors [5]:

"This version also lacks fast reflection and line numbers in error
messages. For this reason, we recommend Guice+AOP even in applications
that don't use method interceptors."

Fast reflection: method invocation via reflection in old JDKs could be
slow as it involved JNI calls, which was why generating bytecode to do
the same could turn out to be faster (depending how often the call was
made, etc.). Modern JDKs will now do the same as "fast reflection" and
generate Java code for reflective operations once they go above a
certain threshold, controlled by the sun.reflect.inflationThreshold
system property. So it's not necessarily true that the no-AOP build will
be slower - it depends on the application.

Line numbers: assuming the application doesn't regularly throw error
messages involving injection then the no-AOP build won't make any
difference because it's not throwing errors to begin with. The only
difference a developer would see if the error involved a missing binding
and developer needed the additional line number information.

We could always make it configurable, so the person deploying could
choose between the two flavours. That way if we really needed the extra
information when debugging an error we could temporarily swap in the AOP
version, by reverting this change.

Moreover, there are also other prominent Guice users who use no-AOP
Guice distribution, like Apache Maven and Sonatype Nexus.

[1] https://github.com/google/guice/issues/1133
[2] https://github.com/google/guice/wiki/OptionalAOP

Bug: Issue 12448
Change-Id: I4a052850d14d78ce8c298e58fe5e8604f7559049
3 files changed
tree: c2d42e8fc1392677ccccf26128391fd47cb68855
  1. .settings/
  2. antlr3/
  3. contrib/
  4. Documentation/
  5. e2e-tests/
  6. gerrit-gwtdebug/
  7. gerrit-gwtui/
  8. gerrit-gwtui-common/
  9. gerrit-plugin-gwtui/
  10. java/
  11. javatests/
  12. lib/
  13. plugins/
  14. polygerrit-ui/
  15. prolog/
  16. prologtests/
  17. proto/
  18. resources/
  19. tools/
  20. webapp/
  21. .bazelignore
  22. .bazelproject
  23. .bazelrc
  24. .bazelversion
  25. .editorconfig
  26. .git-blame-ignore-revs
  27. .gitignore
  28. .gitmodules
  29. .gitreview
  30. .mailmap
  31. .pydevproject
  32. .zuul.yaml
  33. BUILD
  34. COPYING
  35. INSTALL
  36. Jenkinsfile
  37. package.json
  38. README.md
  39. SUBMITTING_PATCHES
  40. version.bzl
  41. WORKSPACE
README.md

Gerrit Code Review

Gerrit is a code review and project management tool for Git based projects.

Build Status

Objective

Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.

Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.

Documentation

For information about how to install and use Gerrit, refer to the documentation.

Source

Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.

Reporting bugs

Please report bugs on the issue tracker.

Contribute

Gerrit is the work of hundreds of contributors. We appreciate your help!

Please read the contribution guidelines.

Note that we do not accept Pull Requests via the Github mirror.

Getting in contact

The Developer Mailing list is repo-discuss on Google Groups.

License

Gerrit is provided under the Apache License 2.0.

Build

Install Bazel and run the following:

    git clone --recurse-submodules https://gerrit.googlesource.com/gerrit
    cd gerrit && bazel build release

Install binary packages (Deb/Rpm)

The instruction how to configure GerritForge/BinTray repositories is here

On Debian/Ubuntu run:

    apt-get update & apt-get install gerrit=<version>-<release>

NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.

On CentOS/RedHat run:

    yum clean all && yum install gerrit-<version>[-<release>]

On Fedora run:

    dnf clean all && dnf install gerrit-<version>[-<release>]

Use pre-built Gerrit images on Docker

Docker images of Gerrit are available on DockerHub

To run a CentOS 7 based Gerrit image:

    docker run -p 8080:8080 gerritforge/gerrit-centos7[:version]

To run a Ubuntu 15.04 based Gerrit image:

    docker run -p 8080:8080 gerritforge/gerrit-ubuntu15.04[:version]

NOTE: release is optional. Last released package of the version is installed if the release number is omitted.