Alexander Bird
Alexander Bird

Reputation: 40639

Maven: using plugin in local filesystem

I am new to Maven and made a hello world maven plugin (as tutorialed here: http://maven.apache.org/guides/plugin/guide-java-plugin-development.html).

I also have a hello world maven project (not a plugin) as documented here: http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

Now, I want the project to include the hello-world plugin because that plugin has a "sayhi" goal I want to run.

How do I do this? What is the absolute easiest, fastest way, and what is the most 'proper' way?

Upvotes: 0

Views: 496

Answers (1)

matt b
matt b

Reputation: 139931

  1. Run mvn install on the plugin so it is installed in your local Maven repository.
  2. In the other project, add a <plugin> element under <build>:

For example:

<build>
    <plugins>
        <plugin>      
            <groupId>your-groupid</groupId>
            <artifactId>your-artifactId</artifactId>
            <version>...</version>
        </plugin>
    </plugins>
    ...

Upvotes: 4

Related Questions