greymatter-io / nifi-sdk

Custom processors, scripts, and templates for using Grey Matter Data with Apache NiFi
Apache License 2.0
4 stars 2 forks source link

pgp #24

Closed joshua-rutherford closed 4 years ago

joshua-rutherford commented 4 years ago

@lucasmoten, @dborncamp and @TheMover,

I've added a PGP private key (private.asc) and an envrionment file (.environment) that when sourced will get mvn clean verify to pass.

Note that PGP_KEYS_ENCODED (the environment variable in circleci) is just a base64 encoded version of a key like that in private.asc. It's base64 encoded to make setting it via circleci easier but to use it you need to convert it to PGP_KEYS like this: https://github.com/DecipherNow/bouncycastle-maven-plugin/blob/master/.circleci/config.yml#L43.

Also, you may consider running the signature bits in a profile that you can disable when running locally. I don't recall why I targeted verify with the plugin but is suspect that you need the jars built and thats the first place they actually exist.

dborncamp commented 4 years ago

mvn clean verify works if I source the .environment but it does not get sourced automatically.

joshua-rutherford commented 4 years ago

Can you do the following and post the output:

  1. env | grep PGP
  2. mvn clean verify -e
dborncamp commented 4 years ago

In a fresh terminal without sourcing .evnironment directly:

zsh 2% env | grep PGP
zsh 3% mvn clean verify -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for io.greymatter:nifi-data-nar:nar:1.0.1-SNAPSHOT
[WARNING] 'version' contains an expression but should be a constant. @ io.greymatter:nifi-data-nar:${parent.version}, /Users/dborncamp/cybercom/nifi-sdk/gmd-sdk/nifi-data-nar/pom.xml, line 26, column 14
[WARNING] The expression ${parent.version} is deprecated. Please use ${project.parent.version} instead. @ io.greymatter:nifi-data-nar:${parent.version}, /Users/dborncamp/cybercom/nifi-sdk/gmd-sdk/nifi-data-nar/pom.xml
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] nifi-data                                                          [pom]
[INFO] nifi-data-processors                                               [jar]
[INFO] nifi-data-nar                                                      [nar]
[INFO]
[INFO] ----------------------< io.greymatter:nifi-data >-----------------------
[INFO] Building nifi-data 1.0.1-SNAPSHOT                                  [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ nifi-data ---
[INFO] Deleting /Users/dborncamp/cybercom/nifi-sdk/gmd-sdk/target
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven-version) @ nifi-data ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ nifi-data ---
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ nifi-data ---
[INFO] ShortRevision tag detected. The value is '7'.
[INFO] Executing: /bin/sh -c cd '/Users/dborncamp/cybercom/nifi-sdk/gmd-sdk' && 'git' 'rev-parse' '--verify' '--short=7' 'HEAD'
[INFO] Working directory: /Users/dborncamp/cybercom/nifi-sdk/gmd-sdk
[INFO] Storing buildNumber: 9f6b2d5 at timestamp: 1600798177286
[INFO] Storing buildScmBranch: pgp
[INFO]
[INFO] --- maven-remote-resources-plugin:1.7.0:process (process-resource-bundles) @ nifi-data ---
[INFO] Preparing remote bundle org.apache:apache-jar-resource-bundle:1.4
[INFO] Copying 3 resources from 1 bundle.
[INFO]
[INFO] --- scala-maven-plugin:4.2.0:compile (default) @ nifi-data ---
[WARNING]  Expected all dependencies to require Scala version: 2.12.10
[WARNING]  org.scalatest:scalatest_2.12:3.0.5 requires scala version: 2.12.4
[WARNING] Multiple versions of scala libraries detected!
[INFO] compile in 0.0 s
[INFO] No sources to compile
[INFO]
[INFO] --- scala-maven-plugin:4.2.0:compile (compile) @ nifi-data ---
[WARNING]  Expected all dependencies to require Scala version: 2.12.10
[WARNING]  org.scalatest:scalatest_2.12:3.0.5 requires scala version: 2.12.4
[WARNING] Multiple versions of scala libraries detected!
[INFO] compile in 0.0 s
[INFO] No sources to compile
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (groovy-tests) @ nifi-data ---
[INFO] No sources to compile
[INFO]
[INFO] --- scala-maven-plugin:4.2.0:testCompile (test-compile) @ nifi-data ---
[WARNING]  Expected all dependencies to require Scala version: 2.12.10
[WARNING]  org.scalatest:scalatest_2.12:3.0.5 requires scala version: 2.12.4
[WARNING] Multiple versions of scala libraries detected!
[INFO] compile in 0.0 s
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (test) @ nifi-data ---
[INFO] No tests to run.
[INFO]
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ nifi-data ---
Discovery starting.
Discovery completed in 43 milliseconds.
Run starting. Expected test count is: 0
DiscoverySuite:
Run completed in 97 milliseconds.
Total number of tests run: 0
Suites: completed 1, aborted 0
Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
No tests were executed.
[INFO]
[INFO] --- maven-site-plugin:3.7.1:attach-descriptor (attach-descriptor) @ nifi-data ---
[INFO] No site descriptor found: nothing to attach.
[INFO]
[INFO] --- bouncycastle-maven-plugin:1.1.1:sign (sign-artifacts) @ nifi-data ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for nifi-data 1.0.1-SNAPSHOT:
[INFO]
[INFO] nifi-data .......................................... FAILURE [  2.406 s]
[INFO] nifi-data-processors ............................... SKIPPED
[INFO] nifi-data-nar ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.633 s
[INFO] Finished at: 2020-09-22T12:09:39-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.deciphernow:bouncycastle-maven-plugin:1.1.1:sign (sign-artifacts) on project nifi-data: The parameters 'userId' for goal com.deciphernow:bouncycastle-maven-plugin:1.1.1:sign are missing or invalid -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.deciphernow:bouncycastle-maven-plugin:1.1.1:sign (sign-artifacts) on project nifi-data: The parameters 'userId' for goal com.deciphernow:bouncycastle-maven-plugin:1.1.1:sign are missing or invalid
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginParameterException: The parameters 'userId' for goal com.deciphernow:bouncycastle-maven-plugin:1.1.1:sign are missing or invalid
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields (DefaultMavenPluginManager.java:644)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:597)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[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/PluginParameterException
joshua-rutherford commented 4 years ago

If you haven't sourced that file this is the expected behavior. If you wanted to handle that gracefully you'll need to move the execution of the bouncy castle plugin into a profile that is not activated on local builds as per my suggestion.

This pull request was just intended to show you an example of how to use the plugin, not how to not use it.