0

I am looking to do some OSS work in order to get hands-on in Software Engineering. I want to contribute to the strongbox.

Problem faced:
I am not able to build strongbox with the build steps given here:

git clone https://github.com/strongbox/strongbox
cd strongbox
mvn clean install

Output:
After running the command mvn clean install the output that I receive is:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Strongbox: Resources [Common]                                      [jar]
[INFO] Strongbox: Resources [Storage API]                                 [jar]
[INFO] Strongbox: Resources                                               [pom]
[INFO] Strongbox: Commons                                                 [jar]
[INFO] Strongbox: Configuration                                           [jar]
[INFO] Strongbox: Data Service                                            [jar]
[INFO] Strongbox: Client                                                  [jar]
[INFO] Strongbox: Metadata [Maven API]                                    [jar]
[INFO] Strongbox: Testing [Core]                                          [jar]
[INFO] Strongbox: Security API                                            [jar]
[INFO] Strongbox: Storage [Core]                                          [jar]
[INFO] Strongbox: Event API                                               [jar]
[INFO] Strongbox: Authentication API                                      [jar]
[INFO] Strongbox: User Management                                         [jar]
[INFO] Strongbox: Authentication Provider [Default]                       [jar]
[INFO] Strongbox: Authentication Support                                  [jar]
[INFO] Strongbox: Authentication Provider [LDAP]                          [jar]
[INFO] Strongbox: Authentication Providers                                [pom]
[INFO] Strongbox: Authentication Registry                                 [jar]
[INFO] Strongbox: Security                                                [pom]
[INFO] Strongbox: Storage [API]                                           [jar]
[INFO] Strongbox: Cron [API]                                              [jar]
[INFO] Strongbox: Cron [Tasks]                                            [jar]
[INFO] Strongbox: Storage [Maven Layout Provider]                         [jar]
[INFO] Strongbox: Storage [Nuget Layout Provider]                         [jar]
[INFO] Strongbox: Storage [NPM Layout Provider]                           [jar]
[INFO] Strongbox: Storage [PyPi Layout Provider]                          [jar]
[INFO] Strongbox: Storage [Raw Layout Provider]                           [jar]
[INFO] Strongbox: Storage Layout Providers                                [pom]
[INFO] strongbox-storage-rpm-layout-provider                              [jar]
[INFO] Strongbox: Web Forms                                               [jar]
[INFO] Strongbox: REST Client                                             [jar]
[INFO] Strongbox: Testing [Web]                                           [jar]
[INFO] Strongbox: Testing                                                 [pom]
[INFO] Strongbox: Cron                                                    [pom]
[INFO] Strongbox: Storage [P2 Layout Provider]                            [jar]
[INFO] Strongbox: Storage Maven Layout                                    [pom]
[INFO] Strongbox: Storage                                                 [pom]
[INFO] Strongbox: AQL                                                     [jar]
[INFO] Strongbox: Web Core                                                [jar]
[INFO] Strongbox: Distribution                                            [pom]
[INFO] Strongbox: Masterbuild                                             [pom]
[INFO] 
[INFO] --------< org.carlspring.strongbox:strongbox-common-resources >---------
[INFO] Building Strongbox: Resources [Common] 1.0-SNAPSHOT               [1/42]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ strongbox-common-resources ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-jdk-and-maven-versions) @ strongbox-common-resources ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Strongbox: Masterbuild 1.0-SNAPSHOT:
[INFO] 
[INFO] Strongbox: Resources [Common] ...................... FAILURE [  0.865 s]
[INFO] Strongbox: Resources [Storage API] ................. SKIPPED
[INFO] Strongbox: Resources ............................... SKIPPED
[INFO] Strongbox: Commons ................................. SKIPPED
[INFO] Strongbox: Configuration ........................... SKIPPED
[INFO] Strongbox: Data Service ............................ SKIPPED
[INFO] Strongbox: Client .................................. SKIPPED
[INFO] Strongbox: Metadata [Maven API] .................... SKIPPED
[INFO] Strongbox: Testing [Core] .......................... SKIPPED
[INFO] Strongbox: Security API ............................ SKIPPED
[INFO] Strongbox: Storage [Core] .......................... SKIPPED
[INFO] Strongbox: Event API ............................... SKIPPED
[INFO] Strongbox: Authentication API ...................... SKIPPED
[INFO] Strongbox: User Management ......................... SKIPPED
[INFO] Strongbox: Authentication Provider [Default] ....... SKIPPED
[INFO] Strongbox: Authentication Support .................. SKIPPED
[INFO] Strongbox: Authentication Provider [LDAP] .......... SKIPPED
[INFO] Strongbox: Authentication Providers ................ SKIPPED
[INFO] Strongbox: Authentication Registry ................. SKIPPED
[INFO] Strongbox: Security ................................ SKIPPED
[INFO] Strongbox: Storage [API] ........................... SKIPPED
[INFO] Strongbox: Cron [API] .............................. SKIPPED
[INFO] Strongbox: Cron [Tasks] ............................ SKIPPED
[INFO] Strongbox: Storage [Maven Layout Provider] ......... SKIPPED
[INFO] Strongbox: Storage [Nuget Layout Provider] ......... SKIPPED
[INFO] Strongbox: Storage [NPM Layout Provider] ........... SKIPPED
[INFO] Strongbox: Storage [PyPi Layout Provider] .......... SKIPPED
[INFO] Strongbox: Storage [Raw Layout Provider] ........... SKIPPED
[INFO] Strongbox: Storage Layout Providers ................ SKIPPED
[INFO] strongbox-storage-rpm-layout-provider .............. SKIPPED
[INFO] Strongbox: Web Forms ............................... SKIPPED
[INFO] Strongbox: REST Client ............................. SKIPPED
[INFO] Strongbox: Testing [Web] ........................... SKIPPED
[INFO] Strongbox: Testing ................................. SKIPPED
[INFO] Strongbox: Cron .................................... SKIPPED
[INFO] Strongbox: Storage [P2 Layout Provider] ............ SKIPPED
[INFO] Strongbox: Storage Maven Layout .................... SKIPPED
[INFO] Strongbox: Storage ................................. SKIPPED
[INFO] Strongbox: AQL ..................................... SKIPPED
[INFO] Strongbox: Web Core ................................ SKIPPED
[INFO] Strongbox: Distribution ............................ SKIPPED
[INFO] Strongbox: Masterbuild ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.941 s
[INFO] Finished at: 2021-09-28T22:50:20+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-jdk-and-maven-versions) on project strongbox-common-resources: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
[ERROR] 
[ERROR]  Ubuntu 11.0.11+9-Ubuntu-0ubuntu2.20.04 is not a supported JDK version! 
[ERROR]  See https://strongbox.github.io/developer-guide/getting-started.html 
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

From what I could deduce from the info in the Error message here, it is that there is an issue with the supported JDK version, as in the following line-

[ERROR] Ubuntu 11.0.11+9-Ubuntu-0ubuntu2.20.04 is not a supported JDK version!

Questions:

  1. What should I do to rectify this?
  2. Also, is this the best (time-efficient) way to build java software?
  3. And if I were to use IntelliJ IDEA, is it better to use it?
  4. The error message also suggests that the issue can be due to the maven plugin itself. Not sure though, I would appreciate it if someone points in the correct direction.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-jdk-and-maven-versions) on project strongbox-common-resources: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

  1. Also, how to get rid of warnings at the starting of the output.

My system configs are:

  • OS: Ubuntu 20.04
  • Java version: 11.0.11 (installed from steps described here)
  • Maven version: 3.6.3 (installed from steps described here)

Other Info:

  1. I have settings.xml file in ~/.m2/

Thanks in advance

P S
  • 1
  • First to get rid of the warnings: https://stackoverflow.com/q/68593017/296328 second I would check to upgrade the maven-enforcer-plugin version in the build...furthermore I would recommend to install a JDK based on other distros first...because the logged version looks a bit strange... – khmarbaise Sep 28 '21 at 20:38
  • Did you read https://github.com/strongbox/strongbox#requirements ? You need Java 8. – Thorbjørn Ravn Andersen Sep 29 '21 at 05:48

1 Answers1

1

To answer your questions:

  1. You can check the current requirements of the stongbox on the github page:

Requirements

Java 1.8.x (we do not currently support higher versions)

Which would mean that you need to use some version of the Java 1.8.

  1. I don't quite understand this question. Do you mean if Maven is the best way to build Java software or?
  2. That is a matter of a personal opinion. If you have a chance to use Intelij IDEA I would recommend to just check it and decide it for yourself.
  3. The error message is printed by the enforcer plugin as the plugin:

provides goals to control certain environmental constraints such as Maven version, JDK version and OS family along with many more built-in rules and user created rules.

Meaning that in this scenario the enforcer plugin enforced the correct Java version, or to be more specific, it disallowed Java 11 from being used as the project is meaning to be compiled with Java 1.8.

  1. Use Java 1.8 :). Those warnings refer to the reflective operations which are considered illegal in newer Java versions but are fine with Java 1.8.
Piotr Michalczyk
  • 249
  • 1
  • 13