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 8304187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:46:46+00:00 2026-06-08T17:46:46+00:00

I am writing a plugin to Maven. I want to customize action depend on

  • 0

I am writing a plugin to Maven. I want to customize action depend on Maven version (person’s who use my plugin)
something like:

if (MavenVer == "2.2.1") 
    //do some things
if (MavenVer == "3.0")
//do another things

I found out build-helper-maven-plugin but i’m not shure how to use it to do this job.

  • 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-08T17:46:47+00:00Added an answer on June 8, 2026 at 5:46 pm

    I have been looking for an answer to your question and I have come to the conclusion that there is no simple way to get the maven version, or at least I couldn’t find it. The best I was able to find is that the maven-enforcer-plugin contains code that looks up the maven version. However in looking at the maven-enforcer-plugin source code it is a little complicated and involves getting a handle to a RuntimeInformation instance through plexus (the IoC container used by Maven).

    I recommend you take a look at the maven-enforcer-plugin and see if you can use what they did. Pay particular attention to RequireMavenVersion and EnforcerMojo classes.

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

Sidebar

Related Questions

I'm writing a plugin that makes use of the wp_mail function. However I want
I am writing a plugin to use to make a loading-like gif using Raphael
I'm writing some plugin code in a dll that is called by a host
I'm writing a plugin that's modifying an existing UI. One thing I want to
What I'm trying to do is to write some Maven plugin which scans application
When writing a Maven plugin, you can configure various parameters within the mojo class,
I'm writing a very simple Maven plugin, and I am kind of lost with
I used the hibernate3-maven-plugin to automatically create a SQL script I can use to
I'm writing a Maven plugin that takes as a parameter the path to the
I'm writing a Maven plugin (Mojo) that needs to execute a standard set of

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.