Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you install a Maven2 plugin?

I found this plugin for Google App Engine development that seems to be what I need.

But I have no idea how to install it.

I downloaded the JAR file from this page but I don't know where to put it:

http://code.google.com/p/maven-gae-plugin/

Could anyone point me in the right direction? I've tried search for installation instructions but nothing is coming up. It seems like some kind of insider secret. Sorry - I'm new to Maven so I apologize if this should be obvious.

This is the pom I'm using:

http://code.google.com/p/thoughtsite/source/browse/trunk/pom.xml

like image 868
ovr Avatar asked Jun 08 '10 21:06

ovr


People also ask

What is Maven install plugin?

The Install Plugin is used during the install phase to add artifact(s) to the local repository. The Install Plugin uses the information in the POM (groupId, artifactId, version) to determine the proper location for the artifact within the local repository.

How do I run a Maven plugin?

NOTE: Once you have added a plugin to a pom. xml you can use the shorthand notation to execute the plugin: mvn <prefix>:<goal> , commonly the “prefix” is the artifact ID minus the “-maven-plugin”. For example mvn example:version .

How do I know if Maven plugin is installed?

Once Maven is installed, you can check the version by running mvn -v from the command-line. If Maven has been installed, you should see something resembling the following output. If you see this output, you know that Maven is available and ready to be used.


1 Answers

You don't install it, Maven will do that for you. But you need to tell Maven from where it can download the plugin if the plugin is not available in the public repository. So, declare the plugin repository:

<project>
    [...]
    <repositories>
        [...]
        <repository>
            <id>maven-gae-plugin-repo</id>
            <name>maven-gae-plugin repository</name>
            <url>http://maven-gae-plugin.googlecode.com/svn/repository</url>
        </repository>
    </repositories>

    <pluginRepositories>
        [...]
        <pluginRepository>
            <id>maven-gae-plugin-repo</id>
            <name>maven-gae-plugin repository</name>
            <url>http://maven-gae-plugin.googlecode.com/svn/repository</url>
        </pluginRepository>
    </pluginRepositories>
    [...]
</project>

And use the plugin:

<project>
    [...]
    <build>
        <plugins>
            [...]
            <plugin>
                <groupId>net.kindleit</groupId>
                <artifactId>maven-gae-plugin</artifactId>
                <version>[plugin version]</version>
            </plugin>
        </plugins>
    </build>
    [...]
</project>

And let Maven do its job. This is actually documented in the Usage page.

like image 177
Pascal Thivent Avatar answered Nov 15 '22 22:11

Pascal Thivent