naether 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,15 @@ https://github.com/mguymon/naether
10
10
  gem install naether
11
11
 
12
12
 
13
+ === About
14
+
15
+ Built do power the {Buildr Resolver}[https://github.com/mguymon/buildr-resolver] for {Buildr}[https://github.com/apache/buildr],
16
+ enabling dependency resolution to Buildr projects. The Java {Naether.java}[https://github.com/mguymon/naether/blob/master/src/main/java/com/slackworks/naether/Naether.java]
17
+ is a basic wrapper for {Aether}[https://github.com/sonatype/sonatype-aether], Maven 3's dependency resolution framework.
18
+ The Ruby {naether.rb}[https://github.com/mguymon/naether/blob/master/src/main/ruby/naether.rb] provides access to Java
19
+ from Ruby. JRuby is natively supported, other Ruby vms will use {Rjb}[http://rjb.rubyforge.org] to proxy over JNI.
20
+
21
+
13
22
  == License
14
23
 
15
24
  Licensed to the Apache Software Foundation (ASF) under one or more
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -42,7 +42,7 @@ class Naether
42
42
  end
43
43
 
44
44
  # Create new instance. Naether.create_from_paths and Naether.create_from_jars should be
45
- # used instead of Naether.new
45
+ # used instead of Naether.new to ensure the dependencies for Naether are set into the classpath
46
46
  def initialize()
47
47
 
48
48
  if Naether.platform == 'java'
@@ -59,8 +59,12 @@ class Naether
59
59
  end
60
60
 
61
61
  # Add remote repository
62
- def add_remote_repository( url )
63
- @resolver.addRemoteRepository( url )
62
+ def add_remote_repository( url, username = nil, password = nil )
63
+ if username
64
+ @resolver.addRemoteRepositoryByUrl( url, username, password )
65
+ else
66
+ @resolver.addRemoteRepositoryByUrl( url )
67
+ end
64
68
  end
65
69
 
66
70
  # Array of remote repositories
@@ -119,13 +123,35 @@ class Naether
119
123
  @instance.setNotation( notation )
120
124
  @instance.setFilePath( file_path )
121
125
  if opts[:pom_path]
122
- @instance.setPomPath( pom_path )
126
+ @instance.setPomPath( opts[:pom_path] )
123
127
  end
124
128
 
125
- if opts[:user_name] || opts[:pub_key]
126
- @instance.setAuth(opts[:user_name], opts[:password], opts[:pub_key], opts[:pub_key_passphrase] )
129
+ if opts[:username] || opts[:pub_key]
130
+ @instance.setAuth(opts[:username], opts[:password], opts[:pub_key], opts[:pub_key_passphrase] )
127
131
  end
128
132
 
129
133
  @resolver.deployArtifact(@instance)
130
134
  end
135
+
136
+ # filePath to write the pom
137
+ # notation of the pom, groupId:artifactId:type:version
138
+ #
139
+ # loads all resolved dependencies into pom
140
+ def write_pom( notation, file_path )
141
+ if Naether.platform == 'java'
142
+ @project_instance = com.slackworks.naether.MavenProject.new
143
+ else
144
+ projectClass = Rjb::import('com.slackworks.naether.MavenProject')
145
+ @project_instance = projectClass.new
146
+ end
147
+
148
+ @project_instance.setNotation( notation )
149
+
150
+ dependencies().each do |notation|
151
+ @project_instance.addDependency( notation )
152
+ end
153
+
154
+ @project_instance.writePom( file_path )
155
+
156
+ end
131
157
  end
Binary file
data/pom.xml CHANGED
@@ -4,12 +4,23 @@
4
4
 
5
5
  <groupId>com.slackworks</groupId>
6
6
  <artifactId>naether</artifactId>
7
- <version>0.2.1</version>
7
+ <version>0.3.1</version>
8
8
  <packaging>jar</packaging>
9
-
10
9
  <name>naether</name>
11
10
  <url>https://github.com/mguymon/naether</url>
12
-
11
+ <licenses>
12
+ <license>
13
+ <name>The Apache Software License, Version 2.0</name>
14
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
15
+ <distribution>repo</distribution>
16
+ </license>
17
+ </licenses>
18
+ <scm>
19
+ <url>>scm:git:git@github.com/mguymon/naether.git</url>
20
+ <developerConnection>scm:git:git@github.com/mguymon/naether.git</developerConnection>
21
+ <connection>git@github.com/mguymon/naether.git</connection>
22
+ </scm>
23
+
13
24
  <properties>
14
25
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15
26
  <aetherVersion>1.11</aetherVersion>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: naether
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Guymon
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-07 00:00:00 -05:00
18
+ date: 2011-03-10 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -99,7 +99,7 @@ files:
99
99
  - lib/naether.rb
100
100
  - lib/naether/bootstrap.rb
101
101
  - lib/naether/java.rb
102
- - naether-0.2.1.jar
102
+ - naether-0.3.1.jar
103
103
  - pom.xml
104
104
  has_rdoc: true
105
105
  homepage: http://github.com/mguymon/naether
Binary file