Skip to content

Commit 1057660

Browse files
committed
some build improvements
* allow to deploy gem to maven-central and oss.sonatype.org * just let jruby-maven-plugins deal with "-SNAPSHOT" postfix * use a more up2date jar-dependencies and use sematic version contraint
1 parent 0945d72 commit 1057660

File tree

3 files changed

+37
-27
lines changed

3 files changed

+37
-27
lines changed

Mavenfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ gemspec :jar => 'jopenssl', :include_jars => true
55
sonatype_url = 'https://oss.sonatype.org/content/repositories/snapshots/'
66
snapshot_repository :id => 'sonatype', :url => sonatype_url
77

8-
if ( version = model.version.to_s ).index('dev')
9-
# deploy snapshot versions on sonatype !!!
10-
model.version = version.sub('.dev','-SNAPSHOT') unless version.index('-SNAPSHOT')
11-
plugin :deploy, '2.8.1' do
12-
execute_goals( :deploy,
13-
:skip => false,
14-
:altDeploymentRepository => "sonatype-nexus-snapshots::default::#{sonatype_url}" )
15-
end
8+
distribution_management do
9+
snapshot_repository :id => :ossrh, :url => 'https://oss.sonatype.org/content/repositories/snapshots'
10+
repository :id => :ossrh, :url => 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
1611
end
1712

1813
java_target = '1.6'
@@ -75,7 +70,7 @@ plugin( :compiler, '3.1',
7570
# NOTE: maybe '-J-Xbootclasspath/p:${unsafe.jar}' ... as well ?!
7671
end
7772

78-
plugin :clean, :filesets => [
73+
plugin! :clean, :filesets => [
7974
{ :directory => 'lib', :includes => [ 'jopenssl.jar' ] },
8075
{ :directory => 'lib/org' },
8176
{ :directory => 'target', :includes => [ '*' ] },
@@ -93,6 +88,12 @@ jruby_plugin! :gem do
9388
execute_goals :id => 'default-push', :skip => true
9489
end
9590

91+
# we want to have the snapshots on oss.sonatype.org and the released gems
92+
# on maven central
93+
plugin :deploy, '2.8.1' do
94+
execute_goals( :deploy, :skip => false )
95+
end
96+
9697
supported_bc_versions = %w{ 1.47 1.48 1.49 1.50 1.51 }
9798

9899
default_bc_version = File.read('lib/jopenssl/version.rb')[/BOUNCY_CASTLE_VERSION\s?=\s?'(.*?)'/, 1]
@@ -111,7 +112,7 @@ properties( 'jruby.plugins.version' => '1.0.8',
111112
'tesla.dump.readonly' => true )
112113

113114
# make sure we have the embedded jars in place before we run runit plugin
114-
plugin :dependency do
115+
plugin! :dependency do
115116
execute_goal 'copy-dependencies', :phase => 'generate-test-resources', :outputDirectory => '${basedir}/lib', :useRepositoryLayout => true, :includeGroupIds => 'org.bouncycastle'
116117
end
117118

jruby-openssl.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
2323
s.requirements << "jar org.bouncycastle:bcpkix-jdk15on, #{Jopenssl::Version::BOUNCY_CASTLE_VERSION}"
2424
s.requirements << "jar org.bouncycastle:bcprov-jdk15on, #{Jopenssl::Version::BOUNCY_CASTLE_VERSION}"
2525

26-
s.add_development_dependency 'jar-dependencies', '0.0.9'
26+
s.add_development_dependency 'jar-dependencies', '~> 0.1.0'
2727

2828
s.add_development_dependency 'mocha', '~> 1.1.0'
2929
s.add_development_dependency 'ruby-maven'

pom.xml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@
3939
<connection>https://github.com/jruby/jruby-openssl.git</connection>
4040
<url>https://github.com/jruby/jruby-openssl</url>
4141
</scm>
42+
<distributionManagement>
43+
<repository>
44+
<id>ossrh</id>
45+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
46+
</repository>
47+
<snapshotRepository>
48+
<id>ossrh</id>
49+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
50+
</snapshotRepository>
51+
</distributionManagement>
4252
<properties>
4353
<bc.versions>1.50</bc.versions>
4454
<jruby.plugins.version>1.0.8</jruby.plugins.version>
@@ -54,7 +64,7 @@
5464
<dependency>
5565
<groupId>rubygems</groupId>
5666
<artifactId>jar-dependencies</artifactId>
57-
<version>[0.0.9,0.0.9.0.0.0.0.1)</version>
67+
<version>[0.1.0,0.1.99999]</version>
5868
<type>gem</type>
5969
<scope>test</scope>
6070
</dependency>
@@ -191,21 +201,6 @@
191201
<useRepositoryLayout>true</useRepositoryLayout>
192202
</configuration>
193203
</plugin>
194-
<plugin>
195-
<artifactId>maven-deploy-plugin</artifactId>
196-
<version>2.8.1</version>
197-
<executions>
198-
<execution>
199-
<goals>
200-
<goal>deploy</goal>
201-
</goals>
202-
<configuration>
203-
<skip>false</skip>
204-
<altDeploymentRepository>sonatype-nexus-snapshots::default::https://oss.sonatype.org/content/repositories/snapshots/</altDeploymentRepository>
205-
</configuration>
206-
</execution>
207-
</executions>
208-
</plugin>
209204
<plugin>
210205
<groupId>org.codehaus.mojo</groupId>
211206
<artifactId>exec-maven-plugin</artifactId>
@@ -309,6 +304,20 @@
309304
</filesets>
310305
</configuration>
311306
</plugin>
307+
<plugin>
308+
<artifactId>maven-deploy-plugin</artifactId>
309+
<version>2.8.1</version>
310+
<executions>
311+
<execution>
312+
<goals>
313+
<goal>deploy</goal>
314+
</goals>
315+
<configuration>
316+
<skip>false</skip>
317+
</configuration>
318+
</execution>
319+
</executions>
320+
</plugin>
312321
<plugin>
313322
<artifactId>maven-dependency-plugin</artifactId>
314323
<executions>

0 commit comments

Comments
 (0)