Re: Download an artifact and its dependencies without a pom.xml

2017-03-02 Thread Manfred Moser
I have a similar tool that can be used to provision from and to a repository. 

https://github.com/simpligility/maven-repository-tools/tree/master/maven-repository-provisioner

hth

Manfred

Curtis Rueden wrote on 2017-03-02 14:29:

> Hi everyone,
> 
>> My use case is that I want to run a class from a Maven artifact.
> 
> I turned my "synthesize a dummy POM" approach into a full-blown shell
> script called jrun [1].
> 
> You can use it to conveniently run Java code from any remote Maven
> repository. For example, to spin up the Jython REPL:
> 
>$ jrun org.python:jython-standalone
> 
> If you add the ImageJ Maven repository to your ~/.jrunrc:
> 
>[repositories]
>imagej.public = https://maven.imagej.net/content/groups/public
> 
> Then you can launch ImageJ (https://imagej.net/):
> 
>$ jrun net.imagej:imagej
> 
> Or even the entire Fiji distribution of ImageJ (https://fiji.sc/), which as
> of this writing consists of 346 components!
> 
>$ jrun sc.fiji:fiji:LATEST
> 
> All without explicitly downloading or installing anything apart from Maven
> and this one shell script [2].
> 
> If anyone knows a better / standard / best-practices way of doing this,
> please let me know! But I am pretty pumped about how convenient this is. I
> hope that jrun is useful to other developers too.
> 
> Regards,
> Curtis
> 
> P.S. If the Mojohaus devs are interested, perhaps we could fold in
> something like this as a new goal of the exec-maven-plugin.
> 
> [1] https://github.com/ctrueden/jrun
> 
> [2] Windows users need POSIX-compliant shell, though. I did not test it yet.
> 
> --
> Curtis Rueden
> LOCI software architect - https://loci.wisc.edu/software
> ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
> 
> 
> On Thu, Mar 2, 2017 at 9:50 AM, Curtis Rueden  wrote:
> 
>> Hi everyone,
>>
>> Is there an easy way to download an artifact and its dependencies to a
>> folder locally?
>>
>> * dependency:get will download a single artifact without needing a pom.xml.
>> * dependency:copy-dependencies will copy the dependencies of the current
>> project to a target location.
>>
>> But can these two functionalities be combined?
>>
>> My use case is that I want to run a class from a Maven artifact.
>>
>> The best I have come up with so far is to synthesize a dummy POM:
>>
>> g=org.scijava; a=scijava-common; v=RELEASE; m=org.scijava.script.ScriptREPL;
>> echo "4.0.0x> pId>x0<
>> dependencies>$g$a<
>> version>$v" > pom.xml;
>> mvn -DoutputDirectory=. dependency:copy-dependencies; rm pom.xml; java -cp
>> '*' "$m"
>>
>> Can this be done more elegantly?
>>
>> Thanks,
>> Curtis
>>
>> --
>> Curtis Rueden
>> LOCI software architect - https://loci.wisc.edu/software
>> ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
>>
>>
> 


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Download an artifact and its dependencies without a pom.xml

2017-03-02 Thread Curtis Rueden
Hi everyone,

> My use case is that I want to run a class from a Maven artifact.

I turned my "synthesize a dummy POM" approach into a full-blown shell
script called jrun [1].

You can use it to conveniently run Java code from any remote Maven
repository. For example, to spin up the Jython REPL:

$ jrun org.python:jython-standalone

If you add the ImageJ Maven repository to your ~/.jrunrc:

[repositories]
imagej.public = https://maven.imagej.net/content/groups/public

Then you can launch ImageJ (https://imagej.net/):

$ jrun net.imagej:imagej

Or even the entire Fiji distribution of ImageJ (https://fiji.sc/), which as
of this writing consists of 346 components!

$ jrun sc.fiji:fiji:LATEST

All without explicitly downloading or installing anything apart from Maven
and this one shell script [2].

If anyone knows a better / standard / best-practices way of doing this,
please let me know! But I am pretty pumped about how convenient this is. I
hope that jrun is useful to other developers too.

Regards,
Curtis

P.S. If the Mojohaus devs are interested, perhaps we could fold in
something like this as a new goal of the exec-maven-plugin.

[1] https://github.com/ctrueden/jrun

[2] Windows users need POSIX-compliant shell, though. I did not test it yet.

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden


On Thu, Mar 2, 2017 at 9:50 AM, Curtis Rueden  wrote:

> Hi everyone,
>
> Is there an easy way to download an artifact and its dependencies to a
> folder locally?
>
> * dependency:get will download a single artifact without needing a pom.xml.
> * dependency:copy-dependencies will copy the dependencies of the current
> project to a target location.
>
> But can these two functionalities be combined?
>
> My use case is that I want to run a class from a Maven artifact.
>
> The best I have come up with so far is to synthesize a dummy POM:
>
> g=org.scijava; a=scijava-common; v=RELEASE; m=org.scijava.script.ScriptREPL;
> echo "4.0.0x pId>x0<
> dependencies>$g$a<
> version>$v" > pom.xml;
> mvn -DoutputDirectory=. dependency:copy-dependencies; rm pom.xml; java -cp
> '*' "$m"
>
> Can this be done more elegantly?
>
> Thanks,
> Curtis
>
> --
> Curtis Rueden
> LOCI software architect - https://loci.wisc.edu/software
> ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
>
>


Download an artifact and its dependencies without a pom.xml

2017-03-02 Thread Curtis Rueden
Hi everyone,

Is there an easy way to download an artifact and its dependencies to a
folder locally?

* dependency:get will download a single artifact without needing a pom.xml.
* dependency:copy-dependencies will copy the dependencies of the current
project to a target location.

But can these two functionalities be combined?

My use case is that I want to run a class from a Maven artifact.

The best I have come up with so far is to synthesize a dummy POM:

g=org.scijava; a=scijava-common; v=RELEASE;
m=org.scijava.script.ScriptREPL; echo
"4.0.0xx0$g$a$v"
> pom.xml; mvn -DoutputDirectory=. dependency:copy-dependencies; rm
pom.xml; java -cp '*' "$m"

Can this be done more elegantly?

Thanks,
Curtis

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden