You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bruno Melloni <bm...@melloni.com> on 2021/09/21 20:11:41 UTC

Dumb question: How to deploy a command line app?

Given that the whole point of using Maven is to "not have to worry about 
dependencies" I am having the most ironic (and probably trivial) problem:

- Using Maven in Eclipse.

- I wrote a very simple utility.  It builds as part of a JAR that will 
normally be used by other apps, but this utility can be executed from 
the command line.

- So, to run the utility on a server I did a RunAs/Maven/Install.  It 
placed the JAR in the expected .m2 location but... none of the JARs it 
depends on are there.


How do I tell Eclipse to run a Maven Install that puts *everything* 
needed by the project to run in one folder or folder tree?


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


Re: Dumb question: How to deploy a command line app?

Posted by Anders Hammar <an...@hammar.net>.
One can also use the assembly plugin [1] to create a distributable file
that contains all this. That's what I would do.
The standard build process will only build the artifact and put it in the
maven repo, which is what you're seeing currently.

[1] https://maven.apache.org/plugins/maven-assembly-plugin/

/Anders

On Thu, Sep 23, 2021 at 8:11 AM Mantas Gridinas <mg...@gmail.com> wrote:

> Use dependencies plugin and copy-dependencies goal. This will copy over all
> of your dependencies into target/dependency folder. .m2 catalog already
> contains your dependencies but in reapective subfolders. Ex. foo.bar:parser
> would be under .m2/repository/foo/bar/parser
>
> On Thu, Sep 23, 2021, 09:00 Bruno Melloni <bm...@melloni.com> wrote:
>
> > Given that the whole point of using Maven is to "not have to worry about
> > dependencies" I am having the most ironic (and probably trivial) problem:
> >
> > - Using Maven in Eclipse.
> >
> > - I wrote a very simple utility.  It builds as part of a JAR that will
> > normally be used by other apps, but this utility can be executed from
> > the command line.
> >
> > - So, to run the utility on a server I did a RunAs/Maven/Install.  It
> > placed the JAR in the expected .m2 location but... none of the JARs it
> > depends on are there.
> >
> >
> > How do I tell Eclipse to run a Maven Install that puts *everything*
> > needed by the project to run in one folder or folder tree?
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Dumb question: How to deploy a command line app?

Posted by Mantas Gridinas <mg...@gmail.com>.
Use dependencies plugin and copy-dependencies goal. This will copy over all
of your dependencies into target/dependency folder. .m2 catalog already
contains your dependencies but in reapective subfolders. Ex. foo.bar:parser
would be under .m2/repository/foo/bar/parser

On Thu, Sep 23, 2021, 09:00 Bruno Melloni <bm...@melloni.com> wrote:

> Given that the whole point of using Maven is to "not have to worry about
> dependencies" I am having the most ironic (and probably trivial) problem:
>
> - Using Maven in Eclipse.
>
> - I wrote a very simple utility.  It builds as part of a JAR that will
> normally be used by other apps, but this utility can be executed from
> the command line.
>
> - So, to run the utility on a server I did a RunAs/Maven/Install.  It
> placed the JAR in the expected .m2 location but... none of the JARs it
> depends on are there.
>
>
> How do I tell Eclipse to run a Maven Install that puts *everything*
> needed by the project to run in one folder or folder tree?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>