Closed mhoys closed 4 months ago
Thank you Matthias for reporting this issue. I've created PR #71 to fix it. Now the build works again without access to the repository in Azure DevOps.
First you have to install db* CODECOP CLI. It contains the libraries that are not available in public Maven repos. Then you can install this locally like this:
./install_tvdcc_libs.sh /usr/local/bin/tvdcc
The output should look similar to this:
[INFO] Scanning for projects...
[INFO]
[INFO] ------< trivadis.tvdcc:sonar-plsql-cop-custom-validators-plugin >-------
[INFO] Building db* CODECOP for SonarQube (Child) 5.0.2-SNAPSHOT
[INFO] from pom.xml
[INFO] ----------------------------[ sonar-plugin ]----------------------------
[INFO]
[INFO] --- install:3.0.1:install-file (default-cli) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] pom.xml not found in tvdcc.jar
[INFO] Installing /usr/local/bin/tvdcc/tvdcc.jar to /Users/phs/.m2/repository/trivadis/tvdcc/tvdcc/5.0.1/tvdcc-5.0.1.jar
[INFO] Installing /var/folders/db/2cfk09cx239_2r3bsdpgfwhr0000gn/T/mvninstall14880199504595742249.pom to /Users/phs/.m2/repository/trivadis/tvdcc/tvdcc/5.0.1/tvdcc-5.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.321 s
[INFO] Finished at: 2024-05-01T08:48:18+02:00
[INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects...
[INFO]
[INFO] ------< trivadis.tvdcc:sonar-plsql-cop-custom-validators-plugin >-------
[INFO] Building db* CODECOP for SonarQube (Child) 5.0.2-SNAPSHOT
[INFO] from pom.xml
[INFO] ----------------------------[ sonar-plugin ]----------------------------
[INFO]
[INFO] --- install:3.0.1:install-file (default-cli) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] pom.xml not found in plsql-5.0.1.jar
[INFO] Installing /usr/local/bin/tvdcc/lib/plsql-5.0.1.jar to /Users/phs/.m2/repository/trivadis/oracle/plsql/5.0.1/plsql-5.0.1.jar
[INFO] Installing /var/folders/db/2cfk09cx239_2r3bsdpgfwhr0000gn/T/mvninstall13150572552249185557.pom to /Users/phs/.m2/repository/trivadis/oracle/plsql/5.0.1/plsql-5.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.295 s
[INFO] Finished at: 2024-05-01T08:48:19+02:00
[INFO] ------------------------------------------------------------------------
Now the build should work as documented.
The following Maven command
mvn clean package
should produce an output similar to the following:
[INFO] Scanning for projects...
[INFO]
[INFO] ------< trivadis.tvdcc:sonar-plsql-cop-custom-validators-plugin >-------
[INFO] Building db* CODECOP for SonarQube (Child) 5.0.2-SNAPSHOT
[INFO] from pom.xml
[INFO] ----------------------------[ sonar-plugin ]----------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Deleting /Users/phs/github/trivadis/plsql-cop-validators/target
[INFO]
[INFO] --- sonar-packaging:1.21.0.505:check (default-check) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO]
[INFO] --- resources:3.3.0:resources (default-resources) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Copying 31 resources
[INFO]
[INFO] --- compiler:3.12.1:compile (default-compile) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 12 source files with javac [debug release 8] to target/classes
[INFO]
[INFO] --- exec:3.1.1:java (glp) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO]
[INFO] --- exec:3.1.1:java (guidelines3plus) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO]
[INFO] --- resources:3.3.0:testResources (default-testResources) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] skip non existing resourceDirectory /Users/phs/github/trivadis/plsql-cop-validators/src/test/resources
[INFO]
[INFO] --- compiler:3.12.1:testCompile (default-testCompile) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Recompiling the module because of changed dependency.
[INFO] Compiling 9 source files with javac [debug release 17] to target/test-classes
[INFO]
[INFO] --- surefire:3.2.5:test (default-test) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- surefire:3.2.5:test (trivadis-plsql-naming-test) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.trivadis.tvdcc.validators.tests.TrivadisPlsqlNamingTest
[INFO] Tests run: 42, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.747 s -- in com.trivadis.tvdcc.validators.tests.TrivadisPlsqlNamingTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 42, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- surefire:3.2.5:test (trivadis-plsql-naming-properties-file-test) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.trivadis.tvdcc.validators.tests.TrivadisPlsqlNamingPropertiesFileTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.324 s -- in com.trivadis.tvdcc.validators.tests.TrivadisPlsqlNamingPropertiesFileTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- surefire:3.2.5:test (trivadis-plsql-naming-system-properties-test) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.trivadis.tvdcc.validators.tests.TrivadisPlsqlNamingSystemPropertiesTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.303 s -- in com.trivadis.tvdcc.validators.tests.TrivadisPlsqlNamingSystemPropertiesTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- surefire:3.2.5:test (glp-test) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.trivadis.tvdcc.validators.tests.GLPTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.349 s -- in com.trivadis.tvdcc.validators.tests.GLPTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- surefire:3.2.5:test (sqlinjection-test) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.trivadis.tvdcc.validators.tests.SQLInjectionTest
[INFO] Tests run: 25, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.149 s -- in com.trivadis.tvdcc.validators.tests.SQLInjectionTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 25, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- surefire:3.2.5:test (override-trivadis-guidelines-test) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.trivadis.tvdcc.validators.tests.OverrideTrivadisGuidelinesTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.392 s -- in com.trivadis.tvdcc.validators.tests.OverrideTrivadisGuidelinesTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- surefire:3.2.5:test (trivadis-guidelines-3plus-test) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.trivadis.tvdcc.validators.tests.TrivadisGuidelines3PlusTest
[INFO] Tests run: 13, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.555 s -- in com.trivadis.tvdcc.validators.tests.TrivadisGuidelines3PlusTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 13, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- surefire:3.2.5:test (hint-test) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.trivadis.tvdcc.validators.tests.HintTest
[INFO] Tests run: 39, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.603 s -- in com.trivadis.tvdcc.validators.tests.HintTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 39, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- sonar-packaging:1.21.0.505:sonar-plugin (default-sonar-plugin) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] -------------------------------------------------------
[INFO] Plugin definition in update center
[INFO] Key: plsqlcopcustomvalidators
[INFO] Name: db* CODECOP for SonarQube (Child)
[INFO] Description: Custom validators to analyze PL/SQL and SQL code. Extends db* CODECOP for SonarQube (Standalone/Secondary), db* CODECOP CLI and db* CODECOP for SQL Developer.
[INFO] Version: 5.0.2-SNAPSHOT
[INFO] Display Version: 5.0.2-SNAPSHOT
[INFO] Entry-point Class: com.trivadis.sonar.plugin.PlsqlCustomPlugin
[INFO] Required Plugins:
[INFO] Does the plugin support SonarLint?: false
[INFO] Use Child-first ClassLoader: false
[INFO] Base Plugin: plsqlcop
[INFO] Homepage URL: https://github.com/Trivadis/plsql-cop-validators
[INFO] Minimal SonarQube Version: 7.9
[INFO] Licensing: CC BY-NC-ND 3.0
[INFO] Organization: Trivadis - Part of Accenture
[INFO] Organization URL: https://www.accenture.com/
[INFO] Terms and Conditions:
[INFO] Issue Tracker URL: https://github.com/Trivadis/plsql-cop-validators/issues
[INFO] Build date: 2024-05-01T08:50:57+0200
[INFO] Sources URL: https://github.com/Trivadis/plsql-cop-validators
[INFO] Developers: Philipp Salvisberg
[INFO] Minimal JRE Specification Version:
[INFO] Minimal Node.js Version:
[INFO] -------------------------------------------------------
[INFO] Building jar: /Users/phs/github/trivadis/plsql-cop-validators/target/sonar-plsql-cop-custom-validators-plugin-5.0.2-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.762 s
[INFO] Finished at: 2024-05-01T08:50:57+02:00
[INFO] ------------------------------------------------------------------------
Please let us know if this worked for you. Thank you.
Thanks Philipp, it looks like it's failing now on the "mvn clean package" command. I'm using Apache Maven 3.8.8 and Java 17.0.11. Can you have a look?
$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------< trivadis.tvdcc:sonar-plsql-cop-custom-validators-plugin >-------
[INFO] Building db* CODECOP for SonarQube (Child) 5.0.2-SNAPSHOT
[INFO] from pom.xml
[INFO] ----------------------------[ sonar-plugin ]----------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Deleting C:\dbCODECOPv501\plsql-cop-validators-main\plsql-cop-validators-main\target
[INFO]
[INFO] --- sonar-packaging-maven-plugin:1.21.0.505:check (default-check) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO]
[INFO] --- maven-resources-plugin:3.3.1:resources (default-resources) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Copying 29 resources from src\main\resources to target\classes
[INFO]
[INFO] --- maven-compiler-plugin:3.12.1:compile (default-compile) @ sonar-plsql-cop-custom-validators-plugin ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 12 source files with javac [debug release 8] to target\classes
[INFO]
[INFO] --- exec-maven-plugin:3.1.1:java (glp) @ sonar-plsql-cop-custom-validators-plugin ---
[WARNING]
java.lang.NullPointerException
at java.io.File.<init> (File.java:278)
at com.trivadis.tvdcc.genmodel.GenRulesXml.getExample (GenRulesXml.java:36)
at com.trivadis.tvdcc.genmodel.GenRulesXml.generate (GenRulesXml.java:200)
at com.trivadis.tvdcc.generators.GLPGenmodel.genRulesXml (GLPGenmodel.java:36)
at com.trivadis.tvdcc.generators.GLPGenmodel.main (GLPGenmodel.java:42)
at org.codehaus.mojo.exec.ExecJavaMojo.lambda$execute$0 (ExecJavaMojo.java:283)
at java.lang.Thread.run (Thread.java:842)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.819 s
[INFO] Finished at: 2024-05-03T08:15:21+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.1:java (glp) on project sonar-plsql-cop-custom-validators-plugin: An exception occurred while executing the Java class. null: NullPointerException -> [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
Ok, that's not good. It works on my machine and the CI environment. This might be platform-specific. Which OS/version are you using? This could help me to reproduce the issue.
I'm using Microsoft Windows 64-bit v23H2 (Version 10.0.22631.3447).
I merged PR #72 which should fix the build issue on Windows. At least it fixed it on my Windows 10 machine.
Could you please give it a try and let me know if it worked? Thank you.
Yes, working fine now! Thanks!!
Glad to hear. Thanks for reporting back.
Hi, I'm trying to build db*CODECOP v5.0.1 using the documentation on the following page: https://github.com/Trivadis/plsql-cop-validators?tab=readme-ov-file, section "How To Build". In step 5, I'm getting the following error messages:
$ mvn -Dtvdcc.basedir=C:\dbCODECOPv501\tvdcc-5.0.1 clean package
Any idea how I can solve this?
Thanks Matthias