jruby-openssl 0.16.2-java → 0.19.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4ee516b3ef8e6244b038e411f6ffd2ab3636354436cbd35dda721cd5fe8ce26
4
- data.tar.gz: 4eaea6e9b394b2531f0f1f77560f8e25e26fe8875a4077a23fdd98b0a4e1d280
3
+ metadata.gz: d303c479c506753df7b876af7963e7eea17311aff21f7830deab8fb406a99e85
4
+ data.tar.gz: 24f04a2d978a80711b6271e748068037ad8b4ce4b0f2607ba57aab283c7d980d
5
5
  SHA512:
6
- metadata.gz: e022537b9d08c6ba9780b1690b11b0feac7d6bee39b250f733f422cba4a08c32738ef0ff8bb08e549254a11b5d8920a1b97feef913ed13e3b1f0a051bd7266b4
7
- data.tar.gz: '0335588f3399b8d039b68ab534c60e2af850ab7f04e2e4cf96e4ef85e8d9ef24f3f4f687e7a392d148c82cc2704c0788081825220fb664df522c1c99cc754fa2'
6
+ metadata.gz: 43e9318c7276016bec340d935b6e78b019c6a1959cbed2c5b0f2545617618b84e6da586d83291a5dd55d9609d2534fe051228a8af99104e8e96d85054c53e025
7
+ data.tar.gz: caabdffeedc0fc4a813be83222cceddfc85d254959f32a81ad9b908a84a3feec977b67628484b7af72f30cbbc3469c44287934d8a0945d8782e147e2dee4e0d7
data/History.md CHANGED
@@ -1,3 +1,150 @@
1
+ ## 0.19.1
2
+
3
+ X25519/X448 key support and DH key reading, and a (final) round of provider
4
+ routing driven by the FIPS variant
5
+
6
+ - [feat] X25519/X448 type `PKey` support
7
+ `PKey.read`, `generate_key` and `new_raw_private/public_key` now handle XDH
8
+ - [feat] read DH keys (not just DH parameters)
9
+ PKCS#8 and SubjectPublicKeyInfo DH keys previously failed to parse
10
+ - [compat] read DH parameters via `OpenSSL::PKey.read`
11
+ - [compat] ASN.1 objects for the RFC 8410 curves
12
+ `ASN1::ObjectId` could not resolve X25519/X448/ED25519/ED448 by name or OID
13
+ - [compat] `PKey#inspect` reporting `oid` and `type_name`
14
+ - [compat] define `OP_NO_RENEGOTIATION` constant
15
+ - [fix] read back DER written by `PKey#to_der`
16
+ `PKey.read` only tried PKCS#8 on DER input
17
+ - [fix] raise `PKeyError` for unsupported public key algorithm
18
+ - [fix] raise `SSLError` on handshake failure in connect (#204)
19
+ JSSE may abort handshake with a plain exception when no protocol is enabled
20
+ - [compat] read and write PKCS12 through Bouncy Castle
21
+ supports OpenSSL 3 PBES2/PBKDF2 encryption and PBMAC1 MACs without JDK KeyStore
22
+ - [compat] honor `PKCS12.create` PBE and iteration arguments
23
+ regular mode writes requested legacy PBE algorithms (FIPS rejects unapproved)
24
+ - [feat] honor configured Java trust store properties
25
+ load explicit `javax.net.ssl.trustStore` using the configured `trustStoreType`,
26
+ `trustStoreProvider` and `trustStorePassword`
27
+ - [deps] bump bcprov artifact to latest patch (1.85.2)
28
+
29
+ ### Provider Routing
30
+
31
+ Operations that resolved through JDK security now go to the configured provider.
32
+
33
+ - [fips] pin provider when signing certificates and CRLs
34
+ - [fips] use provider when verifying certificates
35
+ `X509Certificate#verify(PublicKey)` goes to the JDK default and a certificate
36
+ read from a JKS keystore stays a `sun.security.x509.X509CertImpl`
37
+ - [fips] generate DSA keys through provider
38
+ `generate_key!` derived private exponent by hand instead of asking for a key pair
39
+ - [fips] keep cipher policy + OCSP digests on provider
40
+ - [fips] report **fips_mode** based on approved-only
41
+ `OpenSSL.fips_mode` now reports whether FIPS is being *enforced*, as C does;
42
+ `OPENSSL_FIPS` reports whether the build is FIPS-*capable*
43
+
44
+ ## 0.19.0
45
+
46
+ FIPS support, distributed as a **separate, dual GPL/commercial artifact**.
47
+
48
+ Alongside FIPS, this release switches TLS to BouncyCastle's JSSE provider by
49
+ default (session reuse, ChaCha20-Poly1305, session/servername callbacks), and
50
+ lands an extensive X.509 verification hardening (name constraints, CRL scope,
51
+ path-length, partial-chain handling and improved hostname verification).
52
+
53
+ NOTE: due considerable amount of changes please treat 0.19 as a beta release.
54
+
55
+ - [feat] FIPS support as a separate `jruby-openssl` artifact bundling BC-FIPS
56
+ - [feat] leverage BouncyCastle's JSSE provider by default for SSL/TLS
57
+ - [build] restore binary compatibility with BC < 1.84
58
+ - [feat] `to_java` conversions (`X500Principal`, `KeyPair`, `MessageDigest`, `Mac`)
59
+ - [feat] pluggable internal logging via a logger interface
60
+ - [feat] route logs through `java.util.logging` (`jruby.openssl.log.logger=jul`)
61
+ - [chore] remove long-deprecated methods and legacy JRuby/JOpenSSL constants
62
+
63
+ ### SSL / TLS
64
+
65
+ - [feat] proper TLS session reuse with the BC provider
66
+ - [compat] add `SSLSession#to_der`, `#to_pem` and `#to_text`
67
+ - [feat] (re)implement SSLContext session callbacks
68
+ - [feat] start calling `servername_cb`
69
+ - [feat] server-only `renegotiation_cb`
70
+ - [feat] TLS 1.2 ChaCha20-Poly1305 cipher suites
71
+ - [fix] `read_nonblock(exception: false)` throwing on TLS 1.3
72
+ - [fix] SSL write data loss on non-blocking partial flush
73
+ - [fix] keep TLS 1.3 with `ciphers=` and a default timeout
74
+ - [fix] `SSLSocket#cipher` returns `[name, version, bits, alg_bits]`
75
+ - [fix] raise on `sysread`/`syswrite` before handshake
76
+ - [fix] `session_reused?` raises before handshake
77
+ - [fix] close connection on hostname-verification failure
78
+ - [compat] emulate early `verify_hostname` during `SSLSocket#connect`
79
+ - [compat] normalize IP address in SAN verify to match MRI
80
+ - [compat] `undef` `SSLContext#dup`/`clone` and reject option writers
81
+ - [compat] `set_params` must OR options (not overwrite them)
82
+ - [fix] serialize concurrent SSL reads/writes to avoid buffer corruption
83
+ - [fix] grow the application read buffer on TLS unwrap `BUFFER_OVERFLOW`
84
+ - [compat] honor `verify_callback` on the `ca_file`/`ca_path` lookup path
85
+
86
+ ### X.509 / certificate verification
87
+
88
+ - [compat] implement `nameConstraints` verification
89
+ - [fix] properly encode `nameConstraints` extension
90
+ - [compat] enforce dNSName name constraints against EE subject CN
91
+ - [compat] enforce CRL issuing-distribution-point scope
92
+ - [fix] align `cert_crl` critical-extension and `removeFromCRL` handling
93
+ - [fix] proper path-length constraint on self-signed roots
94
+ - [fix] make `V_FLAG_PARTIAL_CHAIN` verify correctly
95
+ - [fix] canonicalize X.509 name before hashed-dir lookup
96
+ - [fix] `StoreContext#getExtraData` IndexOutOfBoundsException
97
+ - [fix] cert time checks when not-before/after are equal
98
+ - [compat] `StoreContext#verify` raises on internal error
99
+ - [compat] implement `Store#add_path` for cert lookup
100
+ - [compat] `verify_result` reporting with `VERIFY_NONE` (#25)
101
+ - [compat] set `V_ERR_HOSTNAME_MISMATCH` on hostname fail
102
+ - [compat] expose missing `V_ERR`/`V_FLAG` constants to Ruby
103
+ - [compat] keep X.509 extension order for certs
104
+ - [fix] don't clobber shared (store) verify settings
105
+ - [compat] drop `V_FLAG_CRL_CHECK_ALL` on `DEFAULT_CERT_STORE`
106
+ - [fix] report a malformed `subjectAltName` as an invalid extension
107
+ - [fix] avoid false revocation from `certificateIssuer` CRL entries
108
+ - [fix] proper escaping in `X509::Name`
109
+ - [fix] ASCII-only X.509 name canonicalization
110
+ - [compat] align `X509::StoreContext` state exposure
111
+ - [fix] `subjectAltName` with an `otherName` entry breaking hostname verification (#324)
112
+ - [fix] format the `nameConstraints` extension value like OpenSSL does
113
+
114
+ ### PKey / Cipher / ASN.1
115
+
116
+ - [feat] AES-CCM cipher mode support (#96)
117
+ - [feat] implement `OpenSSL::PKey::EC::Point#invert!`
118
+ - [compat] `PKey.generate_key`/`generate_parameters` (with params/String)
119
+ - [compat] support HMAC key with the generic PKey API
120
+ - [compat] implement `PKey::EC#check_key` validation
121
+ - [compat] support `PKey::EC.new` with 4 args
122
+ - [fix] RSA-PSS reject negative salt and align `sign_pss` default
123
+ - [fix] handle mismatched PSS content/MGF1 digests via fallback
124
+ - [fix] `Cipher#key=` rejects any length mismatch
125
+ - [fix] reject over-length IV for AEAD ciphers
126
+ - [compat] align `Cipher#iv=` and AEAD-only writers
127
+ - [fix] manual block cipher (buffer/padding) edge cases under CBC/ECB
128
+ - [compat] match MRI no-salt cipher derivation
129
+ - [compat] derive cipher IV length from the real block size
130
+ - [fix] PBKDF2 raw password bytes and reject `< 0` iterations
131
+ - [compat] OpenSSL default PBKDF2 iterations for key export
132
+ - [fix] bound ASN.1 nesting depth and fix truncated-input error class
133
+ - [fix] add missing ASN.1 object-ids for SHA-2
134
+ - [compat] switch `BN.pseudo_rand` to secure random
135
+ - [compat] allow CRT parameter setters on RSA
136
+ - [fix] Cipher authentication-tag reset behavior
137
+ - [fix] break `OpenSSL::Config` `.include` reference cycles
138
+
139
+ ### PKCS7 / PKCS12 / OCSP
140
+
141
+ - [feat] implement missing PKCS7 wrapper methods
142
+ - [feat] implement `X509::Request#to_text`
143
+ - [fix] protect PKCS12 key entries with password
144
+ - [fix] wrap mode for PKCS7 key transport
145
+ - [compat] handle `File` object in `PKCS7.obj2bio`
146
+ - [fix] preserve OCSP `NOCERTS` with explicit flags
147
+
1
148
  ## 0.16.2
2
149
 
3
150
  - [fix] PKey.generate_key accepts key as parameters (#366)
data/Mavenfile CHANGED
@@ -1,125 +1,122 @@
1
1
  #-*- mode: ruby -*-
2
2
 
3
- gemspec :jar => 'jopenssl', :include_jars => true
3
+ load File.expand_path('lib/jopenssl/version.rb', File.dirname(__FILE__))
4
+
5
+ gemspec jar: 'jopenssl'
6
+ # gemspec defaults to 'rubygems' groupId
7
+ # `id` resets the version, so pass full GAV (gem 0.20.0.dev -> Maven -SNAPSHOT)
8
+ maven_version = JOpenSSL::VERSION
9
+ maven_version += "-SNAPSHOT" if JOpenSSL::VERSION.match?(/[a-zA-Z]/)
10
+ id "org.jruby.openssl:jruby-openssl:#{maven_version}"
4
11
 
5
12
  distribution_management do
6
- snapshot_repository :id => :ossrh, :url => 'https://oss.sonatype.org/content/repositories/snapshots'
7
- repository :id => :ossrh, :url => 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
13
+ snapshot_repository id: :ossrh, url: 'https://oss.sonatype.org/content/repositories/snapshots'
14
+ repository id: :ossrh, url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
8
15
  end
9
16
 
10
17
  java_target = '1.8'
11
18
  gen_sources = '${basedir}/target/generated-sources' # hard-coded in AnnotationBinder
12
19
 
13
- plugin( 'org.codehaus.mojo:exec-maven-plugin', '3.5.0' ) do
14
-
15
- =begin
16
- invoker_main = '-Djruby.bytecode.version=${compiler.target}'
17
- #invoker_main << ' -classpath '
18
- invoker_main << ' org.jruby.anno.InvokerGenerator'
19
- invoker_main << " #{gen_sources}/annotated_classes.txt ${project.build.outputDirectory}"
20
-
21
- dependency 'org.jruby', 'jruby-core', '${jruby.version}'
22
-
23
- execute_goal :java, :id => 'invoker-generator', :phase => 'process-classes',
24
- :mainClass => 'org.jruby.anno.InvokerGenerator', :classpathScope => 'compile',
25
- #:arguments => [ '${gen.sources}/annotated_classes.txt', '${project.build.outputDirectory}' ] do
26
- :commandlineArgs => "#{gen_sources}/annotated_classes.txt ${project.build.outputDirectory}",
27
- :classpathScope => 'runtime', :additionalClasspathElements => [ '${project.build.outputDirectory}' ],
28
- :includeProjectDependencies => false, :includePluginDependencies => true do
29
-
30
- #systemProperties do
31
- # property '-Djruby.bytecode.version=${compiler.target}'
32
- #end
33
- =end
34
-
35
- execute_goal :exec, :id => 'invoker-generator', :phase => 'process-classes',
36
- :executable => 'java', :classpathScope => 'compile',
37
- :arguments => [ "-Djruby.bytecode.version=#{java_target}",
20
+ plugin 'org.codehaus.mojo:exec-maven-plugin', '3.5.0' do
21
+ execute_goal :exec, id: 'invoker-generator', phase: 'process-classes',
22
+ executable: 'java', classpathScope: 'compile',
23
+ arguments: [ "-Djruby.bytecode.version=#{java_target}",
38
24
  '-classpath', xml( '<classpath/>' ),
39
25
  'org.jruby.anno.InvokerGenerator',
40
26
  "#{gen_sources}/annotated_classes.txt",
41
27
  '${project.build.outputDirectory}' ]
28
+
29
+ # inlines the shim call sites straight into the compiled classes
30
+ execute_goal :exec, id: 'shim-inliner', phase: 'process-classes',
31
+ executable: 'java', classpathScope: 'compile',
32
+ skip: '${shim.inline.skip}', # -Dshim.inline.skip=true to bypass
33
+ arguments: [ '-classpath', xml( '<classpath/>' ),
34
+ '${basedir}/src/build/java/ShimInliner.java',
35
+ '${project.build.outputDirectory}' ]
42
36
  end
43
37
 
44
- plugin( 'org.codehaus.mojo:build-helper-maven-plugin', '3.6.1' ) do
45
- execute_goal 'add-source', :phase => 'process-classes', :sources => [ gen_sources ]
38
+ plugin 'org.codehaus.mojo:build-helper-maven-plugin', '3.6.1' do
39
+ execute_goal 'add-source', phase: 'process-classes', sources: [ gen_sources ]
40
+ end
41
+
42
+ # building needs JDK 11+ (module-info + the ShimInliner source launcher)
43
+ plugin :enforcer, '3.5.0' do
44
+ execute_goal 'enforce', id: 'enforce-java-version',
45
+ rules: { requireJavaVersion: { version: '[11,)' } }
46
46
  end
47
47
 
48
48
  compiler_configuration = {
49
- :source => '1.8', :target => java_target, :release => '8',
50
- :encoding => 'UTF-8', :debug => true,
51
- :showWarnings => true, :showDeprecation => true,
52
- :excludes => [ 'module-info.java' ],
53
- #:jdkToolchain => { :version => '[1.7,11)' },
54
- :generatedSourcesDirectory => gen_sources,
55
- :annotationProcessors => [ 'org.jruby.anno.AnnotationBinder' ]
49
+ source: '1.8', target: java_target, release: '8',
50
+ encoding: 'UTF-8', debug: true,
51
+ showWarnings: true, showDeprecation: true,
52
+ excludes: [ 'module-info.java' ],
53
+ #jdkToolchain: { version: '[1.7,11)' },
54
+ generatedSourcesDirectory: gen_sources,
55
+ annotationProcessors: [ 'org.jruby.anno.AnnotationBinder' ]
56
56
  }
57
- compiler_configuration.delete(:release) if ENV_JAVA['java.specification.version'] == '1.8'
58
-
59
- plugin( :compiler, '3.15.0', compiler_configuration) do
60
-
61
- #execute_goal :compile, :id => 'annotation-binder', :phase => 'compile',
62
- # :generatedSourcesDirectory => gen_sources, #:outputDirectory => gen_sources,
63
- # :annotationProcessors => [ 'org.jruby.anno.AnnotationBinder' ],
64
- # :proc => 'only', # :compilerReuseStrategy => 'alwaysNew',
65
- # :useIncrementalCompilation => false, :fork => true, :verbose => true,
66
- # :compilerArgs => [ '-XDignore.symbol.file=true', '-J-Dfile.encoding=UTF-8' ]
67
57
 
58
+ plugin :compiler, '3.15.0', compiler_configuration do
68
59
  execute_goal :compile,
69
- :id => 'compile-populators', :phase => 'process-classes',
70
- :includes => [ 'org/jruby/gen/**/*.java' ],
71
- :optimize => true,
72
- :compilerArgs => [ '', '-XDignore.symbol.file=true' ]
60
+ id: 'compile-populators', phase: 'process-classes',
61
+ includes: [ 'org/jruby/gen/**/*.java' ],
62
+ optimize: true,
63
+ compilerArgs: [ '', '-XDignore.symbol.file=true' ]
73
64
  end
74
65
 
75
- plugin :clean do
76
- execute_goals( 'clean', :id => 'default-clean', :phase => 'clean',
77
- 'filesets' => [
78
- { :directory => 'lib', :includes => [ 'jopenssl.jar' ] },
79
- { :directory => 'lib/org' },
80
- { :directory => 'target', :includes => [ '*' ] }
81
- ],
82
- 'failOnError' => 'false' )
83
- end
66
+ plugin! :jar, '3.4.1',
67
+ 'outputDirectory' => 'lib', 'finalName' => 'jopenssl',
68
+ 'excludes' => [ 'annotated_classes.txt' ],
69
+ 'archive' => { 'manifestEntries' => { 'JOpenSSL-Variant' => 'main' } }
70
+
71
+ plugin! :clean, '2.4',
72
+ 'filesets' => [
73
+ { directory: 'lib', includes: [ 'jopenssl.jar' ] },
74
+ { directory: 'vendor' },
75
+ { directory: 'target', includes: [ '*' ] }
76
+ ],
77
+ 'failOnError' => 'false'
84
78
 
85
79
  jruby_compile_compat = '9.2.1.0'
86
- jar 'org.jruby:jruby-core', jruby_compile_compat, :scope => :provided
80
+ jar 'org.jruby:jruby-core', jruby_compile_compat, scope: :provided
81
+ jar 'org.ow2.asm:asm-analysis', '9.8', scope: :provided # build-time only (for ShimInliner)
87
82
  # for invoker generated classes we need to add javax.annotation when on Java > 8
88
- jar 'javax.annotation:javax.annotation-api', '1.3.1', :scope => :compile
89
- jar 'org.junit.jupiter:junit-jupiter', '5.11.4', :scope => :test
83
+ jar 'javax.annotation:javax.annotation-api', '1.3.1', scope: :compile
84
+ jar 'org.junit.jupiter:junit-jupiter', '5.11.4', scope: :test
90
85
  # a test dependency to provide digest and other stdlib bits, needed when loading OpenSSL in Java unit tests
91
- jar 'org.jruby:jruby-stdlib', jruby_compile_compat, :scope => :test
86
+ jar 'org.jruby:jruby-stdlib', jruby_compile_compat, scope: :test
92
87
 
93
88
  plugin :surefire, '3.5.5'
94
89
 
95
- # NOTE: to build on Java 11 - installing gems fails (due old jossl) with:
96
- # load error: jopenssl/load -- java.lang.StringIndexOutOfBoundsException
97
- MVN_JRUBY_VERSION = '9.2.19.0'
90
+ MVN_JRUBY_VERSION = '9.4.14.0'
98
91
 
99
92
  jruby_plugin! :gem do
100
93
  # when installing dependent gems we want to use the built in openssl not the one from this lib directory
101
- execute_goal :id => 'default-package', :addProjectClasspath => false, :libDirectory => 'something-which-does-not-exists'
102
- execute_goals :id => 'default-push', :skip => true
94
+ execute_goal id: 'default-package', addProjectClasspath: false, libDirectory: 'something-which-does-not-exists'
95
+ execute_goals id: 'default-push', skip: true
103
96
  end
104
97
 
105
98
  # we want to have the snapshots on oss.sonatype.org and the released gems on maven central
106
99
  plugin :deploy, '3.1.4' do
107
- execute_goals( :deploy, :skip => false )
100
+ # gem.deploy.skip is flipped on by the jar-release profile (jar-only deploy)
101
+ execute_goals( :deploy, skip: '${gem.deploy.skip}' )
108
102
  end
109
103
 
110
- supported_bc_versions = %w{ 1.78 1.79 1.80 1.81 1.82 1.83 1.84 1.85 }
104
+ supported_bc_versions = %w{ 1.80 1.81 1.82 1.83 1.84 1.85 }
111
105
 
112
106
  default_bc_version = File.read File.expand_path('lib/jopenssl/version.rb', File.dirname(__FILE__))
113
107
  default_bc_version = default_bc_version[/BOUNCY_CASTLE_VERSION\s?=\s?'(.*?)'/, 1]
114
108
 
115
- properties( 'jruby.plugins.version' => '3.0.6',
109
+ # reproducible builds: Rakefile passes -Dproject.build.outputTimestamp=$SOURCE_DATE_EPOCH
110
+ properties( 'shim.inline.skip' => 'false',
111
+ 'gem.deploy.skip' => 'false', # jar-release profile sets this true
112
+ 'jruby.plugins.version' => '3.0.6',
116
113
  'jruby.switches' => '-W0', # https://github.com/torquebox/jruby-maven-plugins/issues/94
117
114
  'bc.versions' => default_bc_version,
118
115
  'invoker.test' => '${bc.versions}',
119
116
  # allow to skip all tests with -Dmaven.test.skip
120
117
  'invoker.skip' => '${maven.test.skip}',
121
118
  'skipRunit' => 'true',
122
- 'runit.dir' => 'src/test/ruby/**/test_*.rb',
119
+ 'runit.dir' => 'test/**/test_*.rb',
123
120
  'mavengem.wagon.version' => '2.0.2', # for jruby plugin
124
121
  'mavengem-wagon.version' => '3.0.0', # for polyglot-ruby
125
122
  # use this version of jruby for the jruby-maven-plugins
@@ -127,26 +124,22 @@ properties( 'jruby.plugins.version' => '3.0.6',
127
124
  # dump pom.xml when running 'rmvn'
128
125
  'polyglot.dump.pom' => 'pom.xml', 'polyglot.dump.readonly' => false )
129
126
 
130
- # make sure we have the embedded jars in place before we run runit plugin
131
127
  plugin! :dependency do
132
128
  execute_goal 'copy-dependencies',
133
- :phase => 'generate-test-resources',
134
- :outputDirectory => '${basedir}/lib',
135
- :useRepositoryLayout => true,
136
- :includeGroupIds => 'org.bouncycastle'
129
+ phase: 'generate-test-resources',
130
+ outputDirectory: '${basedir}/vendor',
131
+ useRepositoryLayout: true,
132
+ includeGroupIds: 'org.bouncycastle'
137
133
  end
138
134
 
139
- jruby_plugin(:runit) { execute_goal( :test, :runitDirectory => '${runit.dir}' ) }
140
-
141
135
  invoker_run_options = {
142
- :id => 'tests-with-different-bc-versions',
143
- :projectsDirectory => 'integration',
144
- :pomIncludes => [ '*/pom.xml' ],
145
- :streamLogs => true,
136
+ id: 'tests-with-different-bc-versions',
137
+ projectsDirectory: 'src/it',
138
+ pomIncludes: [ '*/pom.xml' ],
139
+ streamLogs: true,
146
140
  # pass those properties on to the test project
147
- :properties => {
141
+ properties: {
148
142
  'jruby.versions' => '${jruby.versions}',
149
- 'jruby.modes' => '${jruby.modes}',
150
143
  'jruby.openssl.version' => '${project.version}',
151
144
  'bc.versions' => '${bc.versions}',
152
145
  'runit.dir' => '${runit.dir}' }
@@ -155,13 +148,13 @@ invoker_run_options = {
155
148
  jruby_versions = []
156
149
  jruby_versions += %w{ 9.2.19.0 9.2.20.1 }
157
150
  jruby_versions += %w{ 9.3.3.0 9.3.13.0 }
158
- jruby_versions += %w{ 9.4.8.0 9.4.14.0 }
159
- jruby_versions += %w{ 10.0.2.0 }
151
+ jruby_versions += %w{ 9.4.8.0 9.4.14.0 9.4.15.0 9.4.16.0 }
152
+ jruby_versions += %w{ 10.0.1.0 10.0.3.0 10.0.5.0 10.0.6.0 }
160
153
 
161
154
  jruby_versions.each do |version|
162
- profile :id => "test-#{version}" do
155
+ profile id: "test-#{version}" do
163
156
  plugin :invoker, '3.8.1' do
164
- execute_goals( :install, :run, invoker_run_options )
157
+ execute_goals :install, :run, invoker_run_options
165
158
  end
166
159
  properties 'jruby.version' => version,
167
160
  'jruby.versions' => version,
@@ -169,10 +162,104 @@ jruby_versions.each do |version|
169
162
  end
170
163
  end
171
164
 
172
- profile :id => 'release' do
165
+ profile id: 'release' do
173
166
  plugin :gpg, '3.1.0' do
174
- execute_goal :sign, :phase => :verify
167
+ execute_goal :sign, phase: :verify
175
168
  end
176
169
  end
177
170
 
178
- # vim: syntax=Ruby
171
+ # packages everything (lib/ included) into a self-contained jruby-openssl.jar
172
+ # and deploys it as a plain (non-gem) Maven artifact under org.jruby.openssl
173
+ profile id: 'jar-release' do
174
+ jar_release_dir = '${project.build.directory}/jar-release'
175
+ jar_release_src_dir = '${project.build.directory}/jar-release-sources'
176
+ jar_release_modpath = '${project.build.directory}/jar-release-modpath'
177
+ jar_release_file = '${project.build.directory}/${project.build.finalName}.jar'
178
+ jar_release_sources = '${project.build.directory}/${project.build.finalName}-sources.jar'
179
+
180
+ # ship only what is committed, the same way the gemspec picks its (lib) files
181
+ jar_release_rb = `git ls-files lib`.split("\n").select { |f| f.end_with?('.rb') }
182
+ raise 'no lib/**/*.rb tracked by git - cannot assemble the jar-release' if jar_release_rb.empty?
183
+ jar_release_rb = jar_release_rb.map { |f| f.sub(%r{\Alib/}, '') } # relative to lib directory
184
+
185
+ # same rule for the sources jar - explicit list of committed .java files
186
+ jar_release_src = `git ls-files src/main/java`.split("\n").select { |f| f.end_with?('.java') }
187
+ raise 'no src/main/java/**/*.java tracked by git - cannot assemble the jar-release' if jar_release_src.empty?
188
+ jar_release_src = jar_release_src.map { |f| f.sub(%r{\Asrc/main/java/}, '') } # relative to directory
189
+
190
+ properties 'gem.deploy.skip' => 'true', # publish only the jar, not the gem
191
+ 'jar-release.repositoryId' => 'ossrh',
192
+ # release staging by default; override with the snapshots url for SNAPSHOT versions
193
+ 'jar-release.url' => 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
194
+
195
+ plugin :resources, '3.3.1' do
196
+ execute_goal 'copy-resources', id: 'jar-release-classes', phase: 'prepare-package',
197
+ outputDirectory: jar_release_dir,
198
+ resources: [ { directory: '${project.build.outputDirectory}' } ]
199
+ execute_goal 'copy-resources', id: 'jar-release-lib', phase: 'prepare-package',
200
+ outputDirectory: jar_release_dir,
201
+ resources: [ { directory: 'lib', includes: jar_release_rb } ]
202
+ # NOTE: maven-source-plugin refuses to run on a gem-packaged project
203
+ execute_goal 'copy-resources', id: 'jar-release-sources', phase: 'prepare-package',
204
+ outputDirectory: jar_release_src_dir,
205
+ resources: [ { directory: 'src/main/java', includes: jar_release_src } ]
206
+ # the lib/*.rb ships in the sources jar too, same as in the jar-release .jar
207
+ execute_goal 'copy-resources', id: 'jar-release-sources-lib', phase: 'prepare-package',
208
+ outputDirectory: jar_release_src_dir,
209
+ resources: [ { directory: 'lib', includes: jar_release_rb } ]
210
+ # the module descriptor source ships in the sources jar as well
211
+ execute_goal 'copy-resources', id: 'jar-release-sources-module', phase: 'prepare-package',
212
+ outputDirectory: jar_release_src_dir,
213
+ resources: [ { directory: 'src/main/module', includes: [ 'module-info.java' ] } ]
214
+ end
215
+
216
+ # a module path for compiling module-info;
217
+ # the full classpath cannot be used as-is (jnr-* jars split jnr.enxio.channels)
218
+ # main sources compile against the 9.2 compat jruby-core (module 'org.jruby'),
219
+ # but the descriptor requires 'org.jruby.dist' - runtime name since 9.4.13
220
+ plugin! :dependency do
221
+ execute_goal 'copy-dependencies', id: 'jar-release-modpath-bc', phase: 'generate-resources',
222
+ outputDirectory: jar_release_modpath,
223
+ includeGroupIds: 'org.bouncycastle'
224
+ execute_goal 'copy', id: 'jar-release-modpath-jruby', phase: 'generate-resources',
225
+ outputDirectory: jar_release_modpath,
226
+ artifactItems: [ { groupId: 'org.jruby', artifactId: 'jruby-core', version: MVN_JRUBY_VERSION } ]
227
+ end
228
+
229
+ # module-info targets Java 9 bytecode, so compiled separately from the Java 8
230
+ # main sources; patched onto the already compiled classes dir
231
+ plugin 'org.codehaus.mojo:exec-maven-plugin' do
232
+ execute_goal :exec, id: 'jar-release-module-info', phase: 'process-classes',
233
+ executable: 'javac',
234
+ arguments: [ '--release', '9',
235
+ '--module-path', jar_release_modpath,
236
+ '--patch-module', 'org.jruby.ext.openssl=${project.build.outputDirectory}',
237
+ '-d', jar_release_dir,
238
+ '${basedir}/src/main/module/module-info.java' ]
239
+ end
240
+
241
+ plugin :jar, '3.4.1' do
242
+ execute_goal :jar, id: 'jar-release', phase: 'package',
243
+ classesDirectory: jar_release_dir,
244
+ outputDirectory: '${project.build.directory}',
245
+ finalName: '${project.build.finalName}'
246
+
247
+ execute_goal :jar, id: 'jar-release-sources', phase: 'package',
248
+ classesDirectory: jar_release_src_dir,
249
+ outputDirectory: '${project.build.directory}',
250
+ finalName: '${project.build.finalName}',
251
+ classifier: 'sources'
252
+ end
253
+
254
+ plugin :deploy, '3.1.4' do
255
+ execute_goal 'deploy-file', id: 'jar-release-deploy', phase: 'deploy',
256
+ file: jar_release_file,
257
+ sources: jar_release_sources,
258
+ groupId: '${project.groupId}',
259
+ artifactId: '${project.artifactId}',
260
+ version: '${project.version}',
261
+ packaging: 'jar',
262
+ repositoryId: '${jar-release.repositoryId}',
263
+ url: '${jar-release.url}'
264
+ end
265
+ end