You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Frank Wilson <fa...@gmail.com> on 2007/11/02 12:05:24 UTC

running class files compiled with maven

Is there a way to run individual class files with help from maven. For
instance I want to run the main method in one of my classes but the
best I can do is use the java command from my jvm and add all my
libraries inside ~/.m2/repository  to the classpath by hand. Can maven
automate this? I know I can make a .jar with dependencies and a main
class, but that isn't very convenient for development.

Thanks,

Frank

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


Re: running class files compiled with maven

Posted by Wayne Fay <wa...@gmail.com>.
The exec-maven-plugin might be helpful, especially the "java" goal:
http://mojo.codehaus.org/exec-maven-plugin/usage.html

Wayne

On 11/2/07, Frank Wilson <fa...@gmail.com> wrote:
> I do use eclipse, but it's not very handy to rely on an IDE in some
> cases. For instance, say you hand in an assignment built with maven -
> you can't really assume your lecturer is using eclipse.
> On my last handin I only had two deliverables, so I could split my
> project in to a hierarchical project with two artifacts (one console
> app in a jar + deps and one webapp war). However, if there had been
> more minor console programs to deliver it would have been silly to
> make more subprojects. The project would needlessly look more complex
> to an outsider and handling dependencies would have been more tricky.
> So, in this case I was wondering if maven had a mechanism for running
> individual class files without the bureaucracy of making another
> artifact.
>
>
> Thanks,
>
> Frank
>
>
> On 02/11/2007, Antonio Petrelli <an...@gmail.com> wrote:
> > 2007/11/2, Frank Wilson <fa...@gmail.com>:
> > >
> > > I know I can make a .jar with dependencies and a main
> > > class, but that isn't very convenient for development.
> >
> >
> >
> > Development? Are you using an IDE?
> > If yes, see "q4e" or "m2eclipse" for Eclipse, or the Maven eclipse plugin,
> > or mevenide for NetBeans.
> > http://code.google.com/p/q4e/
> > http://m2eclipse.codehaus.org/
> > http://maven.apache.org/plugins/maven-eclipse-plugin/
> > http://mevenide.codehaus.org/
> >
> > Antonio
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: running class files compiled with maven

Posted by Frank Wilson <fa...@gmail.com>.
I do use eclipse, but it's not very handy to rely on an IDE in some
cases. For instance, say you hand in an assignment built with maven -
you can't really assume your lecturer is using eclipse.
On my last handin I only had two deliverables, so I could split my
project in to a hierarchical project with two artifacts (one console
app in a jar + deps and one webapp war). However, if there had been
more minor console programs to deliver it would have been silly to
make more subprojects. The project would needlessly look more complex
to an outsider and handling dependencies would have been more tricky.
So, in this case I was wondering if maven had a mechanism for running
individual class files without the bureaucracy of making another
artifact.


Thanks,

Frank


On 02/11/2007, Antonio Petrelli <an...@gmail.com> wrote:
> 2007/11/2, Frank Wilson <fa...@gmail.com>:
> >
> > I know I can make a .jar with dependencies and a main
> > class, but that isn't very convenient for development.
>
>
>
> Development? Are you using an IDE?
> If yes, see "q4e" or "m2eclipse" for Eclipse, or the Maven eclipse plugin,
> or mevenide for NetBeans.
> http://code.google.com/p/q4e/
> http://m2eclipse.codehaus.org/
> http://maven.apache.org/plugins/maven-eclipse-plugin/
> http://mevenide.codehaus.org/
>
> Antonio
>

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


Re: running class files compiled with maven

Posted by Antonio Petrelli <an...@gmail.com>.
2007/11/2, Frank Wilson <fa...@gmail.com>:
>
> I know I can make a .jar with dependencies and a main
> class, but that isn't very convenient for development.



Development? Are you using an IDE?
If yes, see "q4e" or "m2eclipse" for Eclipse, or the Maven eclipse plugin,
or mevenide for NetBeans.
http://code.google.com/p/q4e/
http://m2eclipse.codehaus.org/
http://maven.apache.org/plugins/maven-eclipse-plugin/
http://mevenide.codehaus.org/

Antonio