Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8517685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:46:25+00:00 2026-06-11T05:46:25+00:00

Complete Maven newb here, so forgive any abused terminology, etc. I’ve built a custom

  • 0

Complete Maven newb here, so forgive any abused terminology, etc.

I’ve built a custom plugin in Maven 3 (one that defines goals for git rebase). I’m able to:

mvn install

No problem. I can then invoke the goal from the command line:

mvn edu.clemson.cs.rsrg:git-plugin:rebase

Everything’s golden. I have this lovely git-plugin-XXX.jar file sitting in my target directory.

I’d like to make my custom goals available to another project such that when other members of the dev team pull down that project’s source, they get my plugin for free (or at least, after a mvn build).

My understanding is that the purist solution is to set up a maven repo for the group and load my plugin there, but that seems overkill for a single hacky plugin.

Thoughts?


I’ve played with doing it via three different plugins so far:

  • addjars-maven-plugin:add-jars

    <plugin>
       <groupId>com.googlecode.addjars-maven-plugin</groupId>
       <artifactId>addjars-maven-plugin</artifactId>
       <version>1.0.4</version>
       <executions>
          <execution>
             <goals>
                <goal>add-jars</goal>
             </goals>
             <configuration>
                <resources>
                   <resource>
                      <directory>${basedir}/plugins</directory>
                   </resource>
                </resources>
             </configuration>
          </execution>
       </executions>
    </plugin>
    

Gives me this error during mvn build:

[ERROR] Error resolving version for plugin 'edu.clemson.cs.rsrg:git-plugin' from the repositories [local (/home/hamptos/.m2/repository), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository

It also causes my later formatting plugin to fail. (Clearly it’s read the jar and determined the group name/plugin name, but then it goes and looks for it in my local repo? Of course it’s not there–I’m trying to install it.)

  • build-helper:attach-artifacts

    <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>build-helper-maven-plugin</artifactId>
       <version>1.7</version>
       <executions>
          <execution>
             <id>attach-artifacts</id>
             <phase>install</phase>
             <goals>
                <goal>attach-artifact</goal>
             </goals>
             <configuration>
                <artifacts>
                   <artifact>
                      <file>${basedir}/plugins/git-plugin-0.1.0a.jar</file>
                      <type>jar</type>
                   </artifact>
                </artifacts>
             </configuration>
          </execution>
       </executions>
    </plugin>
    

Gives me this error during mvn build:

[ERROR] Failed to execute goal org.codehaus.mojo:build-helper-maven-plugin:1.7:attach-artifact (attach-artifacts) on project RESOLVE: Execution attach-artifacts of goal org.codehaus.mojo:build-helper-maven-plugin:1.7:attach-artifact failed: For artifact {edu.clemson.cs.rsrg:RESOLVE:12.09.01a:jar}: An attached artifact must have a different ID than its corresponding main artifact.

(RESOLVE:12.09.01a being the main project. Clearly something’s gone awry here because the plugin and main project definitely have different artifactIDs. Trying to attach the project on top of itself maybe?)

  • maven-install-plugin:install-file

    <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-install-plugin</artifactId>
       <version>2.3.1</version>
       <executions>
          <execution>
             <id>install-git-plugin</id>
             <phase>initialize</phase>
             <goals>
                <goal>install-file</goal>
             </goals>
             <configuration>
                <file>${basedir}/plugins/git-plugin-0.1.0a.jar</file>
                <packaging>jar</packaging>
                <groupId>edu.clemson.cs.rsrg</groupId>
                <artifactId>git-plugin</artifactId>
                <version>0.1.0a</version>
             </configuration>
          </execution>
       </executions>
    </plugin>
    

Seems to work fine until I try to invoke one of the goals like mvn edu.clemson.cs.rsrg:git-plugin:rebase, at which point it gives me this error:

[ERROR] Failed to execute goal edu.clemson.cs.rsrg:git-plugin:0.1.0a:rebase (default-cli) on project RESOLVE: Execution default-cli of goal edu.clemson.cs.rsrg:git-plugin:0.1.0a:rebase failed: Unable to load the mojo 'rebase' (or one of its required components) from the plugin 'edu.clemson.cs.rsrg:git-plugin:0.1.0a': com.google.inject.ProvisionException: Guice provision errors:
[ERROR]
[ERROR] 1) Error in ComponentFactory:ant-mojo
[ERROR] at ClassRealm[plugin>edu.clemson.cs.rsrg:git-plugin:0.1.0a, parent: sun.misc.Launcher$AppClassLoader@e776f7]
[ERROR] while locating org.apache.maven.plugin.Mojo annotated with @com.google.inject.name.Named(value=edu.clemson.cs.rsrg:git-plugin:0.1.0a:rebase)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:46:27+00:00Added an answer on June 11, 2026 at 5:46 am

    You may think it is hacky, but it is the maven way. It needs to be deployed to a maven repo.

    If you keep it in a groupId that you can demonstrably own and it’s open source you can publish it to central

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am sorry but I am a complete noob on using maven. There is
Complete C++ i18n gettext() hello world example has C++ code that works for a
complete noob to Haskell here with probably an even noobier question. I'm trying to
Complete new person to Ruby and Rails here... Have tried some tutorials in the
Here is my complete script... You can just create test.php and throw it in.
I have used auto complete textbox previously. That auto complete works only when i
I need to know the complete filename of a specific artifact in Maven. I
My eclipse version is indigo. I install maven plugin from eclipse install/update: help --->
I am using maven in a project here at work and I've come up
Complete sql noob here. Trying to think about a way to store some data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.