Hi Alex,

>
> artifact(...).from(...) only changes the source of the artifact for a given
> execution.   It doesn't actually install the artifact in the local Maven2
> repo.   If you want to install it, you can do something along the lines of:
>
It actually does install the artifact into the repository. I'll show a
session below.
But I will use your suggestion anyway.

Anders

[505:repository]$ find google
find: google: No such file or directory

[565:words (master)]$ buildr test=no
(in /Users/andersjanmyr/Projects/words, development)
Building words
Skipping tests for words
Skipping tests for words:web
Completed in 0.017s

506:repository]$ find google
google
google/google-collect
google/google-collect/1.0
google/google-collect/1.0/google-collect-1.0.jar
google/google-collect/1.0/google-collect-1.0.pom


Completed in 0.017s
[566:words (master)]$ buildr clean
(in /Users/andersjanmyr/Projects/words, development)
Cleaning words
Completed in 0.042s
[567:words (master)]$ buildr test=no
(in /Users/andersjanmyr/Projects/words, development)
Building words
Downloading 
http://google-collections.googlecode.com/files/google-collect-1.0.zip
google-collect-1..: 100% |.................................|
1.5MB/1.5MB Time: 00:00:25
Installed 
/Users/andersjanmyr/Projects/words/target/zip/google-collect-1.0/google-collect-1.0.jar
as google:google-collect:jar:1.0
Compiling words:core into /Users/andersjanmyr/Projects/words/core/target/classes
Compiling words:core:test into
/Users/andersjanmyr/Projects/words/core/target/test/classes
Skipping tests for words:core
Packaging words-core-1.0.0.jar
Compiling words:cli into /Users/andersjanmyr/Projects/words/cli/target/classes
Note: 
/Users/andersjanmyr/Projects/words/cli/src/main/java/words/cli/WordsCli.java
uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Skipping tests for words
Compiling words:cli:test into
/Users/andersjanmyr/Projects/words/cli/target/test/classes
Skipping tests for words:cli
Skipping tests for words:web
Completed in 28.227s


> google_artifact = artifact('google:google-collect:jar:1.0').tap do |a|
>  unless a.exist?
>    google_zip = download "target/google-collect-1.0.zip" => '
> http://google-collections.googlecode.com/files/google-collect-1.0.zip'
>    google_jar = file("target/zip/google-collect-1.0/google-collect-1.0.jar"
> => unzip('target/zip'=>google_zip))
>    google_jar.invoke
>    a.from(google_jar)
>    a.install
>  end
> end
>
>
>
>> And by the way, I'm giving a presentation on Buildr in Stockholm,
>> Sweden next week since I think Buildr is so good :)
>>
>> http://jwsbuildr10.eventbrite.com/ (In Swedish)
>>
>
> That's awesome!  Thanks for spreading the word.
>
> alex
>



-- 
http://anders.janmyr.com/

Reply via email to