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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:05:34+00:00 2026-06-12T01:05:34+00:00

Is there a way to pause the maven execution flow to provide a command

  • 0
  1. Is there a way to pause the maven execution flow to provide a command prompt so user can input text.
  2. Then I would like the provided text to be stored in a maven properties.
  3. If the user input could be masked that would be a bonus.

This would be really useful to avoid storing passwords in pom.

Many Thanks

  • 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-12T01:05:35+00:00Added an answer on June 12, 2026 at 1:05 am

    You can catch a user input using maven-antrun-plugin.
    The following example show how ask current user the new project version.

        <profile>
            <id>change-version</id>
            <build>
                <defaultGoal>validate</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.7</version>
                        <executions>
                            <execution>
                                <id>catch-new-version</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <target>
                                        <!-- == catch new version in a prompt == -->
                                        <input
                                            message="Please enter the new SNAPSHOT version (current is '${project.version}'): "
                                            addproperty="new-user-version" />
                                    </target>
                                    <exportAntProperties>true</exportAntProperties>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.ant</groupId>
                                <artifactId>ant</artifactId>
                                <version>1.8.4</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>1.3.1</version>
                        <executions>
                            <execution>
                                <id>set-new-version</id>
                                <goals>
                                    <goal>set</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <generateBackupPoms>false</generateBackupPoms>
                                    <newVersion>${new-user-version}</newVersion>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    

    You can run this feature by calling :

    mvn -N -P change-version
    

    Some explanations :

    • The -N- option allow to not recurse into sub-projects.
    • Using
      org.apache.ant:ant:1.8.4 to avoid
      https://issues.apache.org/bugzilla/show_bug.cgi?id=51161
    • Using maven 3.0.4
    • Documentation: maven-antrun-plugin, Input Tag
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there way to get file from windows xp command prompt? I tried to
Is there any way how I can remove the pause overlay in the boxee
Can this solution work? Is there a way to indefinitely pause a thread Is
Is there a way to have Makefiles run automatically (then pause at the end)
Is there any way I can pause the below set of delayed functions from
In C, is there a way to start a timer using setitimer, then pause
Possible duplicate question: Is there a way to indefinitely pause a thread? In my
Is there way to automatically maximize the output window on hitting build and then
is there a way to pause / resume for HTML5 Canvas? Say my code:
Is there a way to temporarily suspend / pause Sharepoint Server 2010, IIS and

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.