naether 0.5.12-java → 0.6.0-java

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Naether
2
2
 
3
- A Java Dependency Resolver using Maven's {Aether}[https://github.com/sonatype/sonatype-aether]
3
+ Naether is a Java Dependency Resolver using Maven's {Aether}[https://github.com/sonatype/sonatype-aether]
4
4
 
5
5
  https://github.com/mguymon/naether
6
6
 
@@ -12,11 +12,12 @@ gem install naether
12
12
 
13
13
  === About
14
14
 
15
- Built to 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 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.
15
+ {Naether}[https://github.com/mguymon/naether/blob/master/src/main/java/com/slackworks/naether/Naether.java]
16
+ is a wrapper for {Aether}[https://github.com/sonatype/sonatype-aether], the Maven dependency resolution framework.
17
+ {Naether.rb}[https://github.com/mguymon/naether/blob/master/src/main/ruby/naether.rb] provides access to Aether
18
+ from Ruby. JRuby is natively supported, other Ruby VMs will use {Rjb}[http://rjb.rubyforge.org] to proxy over JNI.
19
+
20
+ Beyond dependency resolution, provides support to install and deploy artifacts to a Maven repository.
20
21
 
21
22
 
22
23
  == License
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.12
1
+ 0.6.0
data/lib/naether.rb CHANGED
@@ -122,7 +122,11 @@ class Naether
122
122
  end
123
123
  end
124
124
 
125
- # Array of mixed dependencies
125
+ # Array of mixed dependencies.
126
+ # * Artifact notation in the format of groupId:artifactId:version or groupId:artifactId:type:version - 'junit:junit:4.7'
127
+ # * Hash of a single artifaction notation => scope - { 'junit:junit:4.7' => 'test' }
128
+ # * Path to a local pom - 'lib/pom.xml'
129
+ # * Hash of a single path to a local pom => scope - { 'lib/pom.xml' => ['compile','test'] }
126
130
  def dependencies=(dependencies)
127
131
  @resolver.clearDependencies()
128
132
 
@@ -180,14 +184,17 @@ class Naether
180
184
  end
181
185
  alias_method :dependenciesNotation, :dependencies_notation # some javaism snuck in
182
186
 
187
+ # Hash of dependency paths
183
188
  def dependencies_path
184
189
  Naether::Java.convert_to_ruby_hash( @resolver.getDependenciesPath(), true )
185
190
  end
186
191
 
192
+ # Convert dependencies to Classpath friendly string
187
193
  def dependencies_classpath()
188
194
  @resolver.getResolvedClassPath()
189
195
  end
190
196
 
197
+ # Load dependencies to Classpath
191
198
  def load_dependencies_to_classpath
192
199
  jars = dependencies_classpath.split(":")
193
200
  Naether::Java.load_jars(jars)
@@ -258,7 +265,12 @@ class Naether
258
265
  end
259
266
 
260
267
  if Naether.platform == 'java'
261
- deps = @project_instance.getDependenciesNotation( scopes, true )
268
+ if scopes.nil?
269
+ deps = @project_instance.getDependenciesNotation()
270
+ else
271
+ deps = @project_instance.getDependenciesNotation( scopes )
272
+ end
273
+
262
274
  else
263
275
  list = nil
264
276
  if scopes
@@ -266,8 +278,12 @@ class Naether
266
278
  scopes.each do |scope|
267
279
  list.add( scope )
268
280
  end
281
+
282
+ deps = @project_instance._invoke('getDependenciesNotation', 'Ljava.util.List;', list)
283
+ else
284
+ deps = @project_instance.getDependenciesNotation()
269
285
  end
270
- deps = @project_instance._invoke('getDependenciesNotation', 'Ljava.util.List;Z', list, true)
286
+
271
287
  end
272
288
 
273
289
  Naether::Java.convert_to_ruby_array( deps, true )
@@ -282,8 +298,23 @@ class Naether
282
298
  return @project_instance.getVersion()
283
299
  end
284
300
 
285
- # filePath to write the pom
301
+ # Create the XML for a Maven Pom for the notation, groupId:artifactId:type:version
302
+ #
303
+ # loads all resolved dependencies into pom
304
+ def build_pom( notation )
305
+ @project_instance = Naether::Java.create("com.slackworks.naether.maven.Project")
306
+ @project_instance.setProjectNotation( notation )
307
+
308
+ dependencies().each do |notation|
309
+ @project_instance.addDependency( notation )
310
+ end
311
+
312
+ @project_instance.toXml()
313
+
314
+ end
315
+
286
316
  # notation of the pom, groupId:artifactId:type:version
317
+ # filePath to write the pom
287
318
  #
288
319
  # loads all resolved dependencies into pom
289
320
  def write_pom( notation, file_path )
data/naether-0.6.0.jar ADDED
Binary file
data/pom.xml CHANGED
@@ -4,11 +4,14 @@
4
4
 
5
5
  <groupId>com.slackworks</groupId>
6
6
  <artifactId>naether</artifactId>
7
- <version>0.5.12</version>
7
+ <version>0.6.0</version>
8
8
  <packaging>jar</packaging>
9
9
  <name>naether</name>
10
10
  <url>https://github.com/mguymon/naether</url>
11
- <licenses>
11
+ <description>
12
+ A Java Dependency Resolver using Maven’s Aether.
13
+ </description>
14
+ <licenses>
12
15
  <license>
13
16
  <name>The Apache Software License, Version 2.0</name>
14
17
  <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
@@ -16,18 +19,31 @@
16
19
  </license>
17
20
  </licenses>
18
21
  <scm>
19
- <url>>scm:git:git@github.com/mguymon/naether.git</url>
22
+ <url>scm:git:git@github.com/mguymon/naether.git</url>
20
23
  <developerConnection>scm:git:git@github.com/mguymon/naether.git</developerConnection>
21
24
  <connection>git@github.com/mguymon/naether.git</connection>
22
25
  </scm>
23
-
26
+ <developers>
27
+ <developer>
28
+ <id>mguymon</id>
29
+ <name>Michael Guymon</name>
30
+ <email>michael.guymon@gmail.com</email>
31
+ </developer>
32
+ </developers>
33
+ <distributionManagement>
34
+ <repository>
35
+ <id>nexus-releases</id>
36
+ <name>Nexus Release Repository</name>
37
+ <url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
38
+ </repository>
39
+ </distributionManagement>
24
40
  <properties>
25
41
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
26
- <aetherVersion>1.13</aetherVersion>
42
+ <aetherVersion>1.13</aetherVersion>
27
43
  <mavenVersion>3.0.3</mavenVersion>
28
44
  <wagonVersion>1.0</wagonVersion>
29
- <org.slf4j.version>1.6.2</org.slf4j.version>
30
- </properties>
45
+ <org.slf4j.version>1.6.2</org.slf4j.version>
46
+ </properties>
31
47
  <dependencies>
32
48
  <dependency>
33
49
  <groupId>ch.qos.logback</groupId>
@@ -125,7 +141,6 @@
125
141
  </dependencies>
126
142
 
127
143
  <build>
128
-
129
144
  <plugins>
130
145
  <plugin>
131
146
  <groupId>org.apache.maven.plugins</groupId>
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: naether
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.12
5
+ version: 0.6.0
6
6
  platform: java
7
7
  authors:
8
8
  - Michael Guymon
@@ -10,7 +10,8 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-04-13 00:00:00 Z
13
+ date: 2012-04-16 00:00:00 -04:00
14
+ default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: rspec
@@ -73,8 +74,9 @@ files:
73
74
  - lib/naether.rb
74
75
  - lib/naether/bootstrap.rb
75
76
  - lib/naether/java.rb
76
- - naether-0.5.12.jar
77
+ - naether-0.6.0.jar
77
78
  - pom.xml
79
+ has_rdoc: true
78
80
  homepage: http://github.com/mguymon/naether
79
81
  licenses:
80
82
  - Apache
@@ -101,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
103
  requirements: []
102
104
 
103
105
  rubyforge_project: naether
104
- rubygems_version: 1.8.9
106
+ rubygems_version: 1.5.1
105
107
  signing_key:
106
108
  specification_version: 3
107
109
  summary: Java dependency resolver using Maven's Aether
data/naether-0.5.12.jar DELETED
Binary file