You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Hycel Taylor <hy...@gmail.com> on 2006/05/17 22:16:38 UTC

Adding Maven Plugins

Hi,

I'm new to using Maven.  I purchased the book, "Maven A Developer's
Nnotebook", and I've read it cover to cover.  However, it's not up to
date with Maven2.  I've setup my first Maven project and now I'm
trying to download a few Maven plugins.  Initially I need to download
the Spring1.2.6.jar and the latest Hibernate jar.  I've been trying
for the last four hours or so to figure out how to do this to no
avail.

Could someone please explain the steps I need to take in order to do
this?  For example, what are the steps I need to take in order to
download the latest spring core jar?

Thanks in advance for the help.

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


Re: Adding Maven Plugins

Posted by Hycel Taylor <hy...@gmail.com>.
Thanks for all of the help.  I'm starting to get the hang of Maven 2.

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


Re: Adding Maven Plugins

Posted by Alexandre Poitras <al...@gmail.com>.
Just to add a little bit of info on this, when you specify a plugin in
your pom, you do it in the <build> section. It has one main purpose -
configuring the plugin use. You don't need to specify every plugins
you use if you use the default configuration values, Maven 2 is able
to figure it out by itself. So don't worry about it for the moment.
People are a bit scared at first because Maven 2 is pretty smart and
rely on the "Convention over configuration" principle. Have fun!

On 5/18/06, Wayne Fay <wa...@gmail.com> wrote:
> A dependency is "something your project needs during compilation,
> testing, or runtime".
>
> A plugin is "something you want Maven to run during compilation,
> testing, packaging, etc to do *something* to your project/code".
>
> So your project might have a *dependency* on spring core.
>
> And it might use the *plugin* axistools-maven-plugin to generate WSDL
> out of your Java, or Java out of your WSDL.
>
> And it might use the *report* javancss-maven-plugin to report on lines
> of code in your project etc.
>
> I have to imagine this is all covered in the M2 book mentioned
> previously. Can't quote a specific page though... So keep reading. ;-)
>
> Wayne
>
> On 5/17/06, Andrew Kreps <an...@gmail.com> wrote:
> > The default location of your local repository is <home
> > directory>/.m2/repository, and you can walk the tree there to see what
> > has been downloaded.  <home directory> in Windows XP is typically
> > c:\documents and settings\<username>.
> >
> > You should also try running mvn with the -X option, which prints out
> > debug information and makes the process easier to understand.  For
> > example: mvn -X jar:jar
> >
> > On 5/17/06, Hycel Taylor <hy...@gmail.com> wrote:
> > > So, I'm the one who added the dependency to my pom.  However, when I
> > > executed the command, mvn jar:jar, I did not see any messages that it
> > > was downloading the spring core plugin.  So, I have two questions:
> > >
> > > 1) Where can I look to verify that the plugin has been downloaded?
> > >
> > > 2) What's the difference in defining a plugin as apposed to a dependency?
> > >
> > > Thanks.
> > >
> > > ---------------------------------------------------------------------
> > > 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
> >
> >
>
> ---------------------------------------------------------------------
> 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: Adding Maven Plugins

Posted by Wayne Fay <wa...@gmail.com>.
A dependency is "something your project needs during compilation,
testing, or runtime".

A plugin is "something you want Maven to run during compilation,
testing, packaging, etc to do *something* to your project/code".

So your project might have a *dependency* on spring core.

And it might use the *plugin* axistools-maven-plugin to generate WSDL
out of your Java, or Java out of your WSDL.

And it might use the *report* javancss-maven-plugin to report on lines
of code in your project etc.

I have to imagine this is all covered in the M2 book mentioned
previously. Can't quote a specific page though... So keep reading. ;-)

Wayne

On 5/17/06, Andrew Kreps <an...@gmail.com> wrote:
> The default location of your local repository is <home
> directory>/.m2/repository, and you can walk the tree there to see what
> has been downloaded.  <home directory> in Windows XP is typically
> c:\documents and settings\<username>.
>
> You should also try running mvn with the -X option, which prints out
> debug information and makes the process easier to understand.  For
> example: mvn -X jar:jar
>
> On 5/17/06, Hycel Taylor <hy...@gmail.com> wrote:
> > So, I'm the one who added the dependency to my pom.  However, when I
> > executed the command, mvn jar:jar, I did not see any messages that it
> > was downloading the spring core plugin.  So, I have two questions:
> >
> > 1) Where can I look to verify that the plugin has been downloaded?
> >
> > 2) What's the difference in defining a plugin as apposed to a dependency?
> >
> > Thanks.
> >
> > ---------------------------------------------------------------------
> > 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
>
>

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


Re: Adding Maven Plugins

Posted by Andrew Kreps <an...@gmail.com>.
The default location of your local repository is <home
directory>/.m2/repository, and you can walk the tree there to see what
has been downloaded.  <home directory> in Windows XP is typically
c:\documents and settings\<username>.

You should also try running mvn with the -X option, which prints out
debug information and makes the process easier to understand.  For
example: mvn -X jar:jar

On 5/17/06, Hycel Taylor <hy...@gmail.com> wrote:
> So, I'm the one who added the dependency to my pom.  However, when I
> executed the command, mvn jar:jar, I did not see any messages that it
> was downloading the spring core plugin.  So, I have two questions:
>
> 1) Where can I look to verify that the plugin has been downloaded?
>
> 2) What's the difference in defining a plugin as apposed to a dependency?
>
> Thanks.
>
> ---------------------------------------------------------------------
> 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: Adding Maven Plugins

Posted by Hycel Taylor <hy...@gmail.com>.
So, I'm the one who added the dependency to my pom.  However, when I
executed the command, mvn jar:jar, I did not see any messages that it
was downloading the spring core plugin.  So, I have two questions:

1) Where can I look to verify that the plugin has been downloaded?

2) What's the difference in defining a plugin as apposed to a dependency?

Thanks.

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


Re: Adding Maven Plugins

Posted by Carlos Sanchez <ca...@apache.org>.
   <dependency>
     <groupId>org.spingframework</groupId>
     <artifactId>spring-core</artifactId>
     <version>1.2.6</version>
   </dependency>


On 5/17/06, Hycel Taylor <hy...@gmail.com> wrote:
> I'm pretty confused from what I have read:
>
> I do not understand if I should be adding a dependency or a plugin.
> This is what I currently have in my pom file:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.acme.app</groupId>
>   <artifactId>acme1.0</artifactId>
>   <packaging>jar</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <name>Maven Quick Start Archetype</name>
>   <url>http://maven.apache.org</url>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>       <scope>test</scope>
>     </dependency>
>    <!-- Do I add spring as a dependency? -->
>     <dependency>
>       <groupId>spingframework</groupId>
>       <artifactId>spring-core</artifactId>
>       <version>1.2.6</version>
>     </dependency>
>   </dependencies>
> </project>
>
> In the book, Better Builds With Maven, section 2.7 describes getting a
> plugin with the <plugins><plugin> elements.  However, the dtd, does
> not allow a <plugins> element.  It does however allow for
> <pluginRepositories><pluginRepository> elements.
>
> I would like to get the spring core jar plugin to work.  Can any one
> provide a solution the I can add to my pom file?
>
> Thanks in advance
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

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


Re: Adding Maven Plugins

Posted by Hycel Taylor <hy...@gmail.com>.
I'm pretty confused from what I have read:

I do not understand if I should be adding a dependency or a plugin.
This is what I currently have in my pom file:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.acme.app</groupId>
  <artifactId>acme1.0</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Maven Quick Start Archetype</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
   <!-- Do I add spring as a dependency? -->
    <dependency>
      <groupId>spingframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>1.2.6</version>
    </dependency>
  </dependencies>
</project>

In the book, Better Builds With Maven, section 2.7 describes getting a
plugin with the <plugins><plugin> elements.  However, the dtd, does
not allow a <plugins> element.  It does however allow for
<pluginRepositories><pluginRepository> elements.

I would like to get the spring core jar plugin to work.  Can any one
provide a solution the I can add to my pom file?

Thanks in advance

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


Re: Adding Maven Plugins

Posted by Hycel Taylor <hy...@gmail.com>.
Thank you for the references. I'll tear into them right away.

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


Re: Adding Maven Plugins

Posted by Dennis Lundberg <de...@apache.org>.
Hycel Taylor wrote:
> Hi,
> 
> I'm new to using Maven.  I purchased the book, "Maven A Developer's
> Nnotebook", and I've read it cover to cover.  However, it's not up to
> date with Maven2. 

If you want to get updated on Maven 2, I can highly recommend the new 
book "Better Builds with Maven" written by some of the Maven 
contributors. It is available as a free download from this site 
(registration is required)
   http://www.mergere.com/m2book_download.jsp

> I've setup my first Maven project and now I'm
> trying to download a few Maven plugins.  Initially I need to download
> the Spring1.2.6.jar and the latest Hibernate jar.  I've been trying
> for the last four hours or so to figure out how to do this to no
> avail.
> 
> Could someone please explain the steps I need to take in order to do
> this?  For example, what are the steps I need to take in order to
> download the latest spring core jar?

You shouldn't have to download anything manually - Maven should do it 
for you. But for this to happen you need to set up your dependencies 
correctly. Here's an introduction to how dependencies work:
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

-- 
Dennis Lundberg

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