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

  • Home
  • SEARCH
  • 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 671417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:22:17+00:00 2026-05-14T00:22:17+00:00

I use the maven-properties-plugin during the initialization phase to read in a bunch of

  • 0

I use the maven-properties-plugin during the initialization phase to read in a bunch of properties from a properties file.

I also have the jetty plugin configured to set a couple of the project properties – including those read in above – as system properties to jetty.

If I run the result as

mvn initialize jetty:run-war

it works.

If I just say

mvn jetty:run-war

it fails. How can I force a goal specified on the command line to run in a lifecycle that includes the initialization phase?

  • 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-05-14T00:22:17+00:00Added an answer on May 14, 2026 at 12:22 am

    If I just say mvn jetty:run-war it fails.

    That’s not what I’m experiencing. If you look at the documentation of the jetty:run-war goal, you’ll see that it:

    Invokes the execution of the lifecycle phase package prior to executing itself.

    So all the phases preceding package plus the package itself are run and, consequently, the plugins bound to them. And indeed, with the following POM:

    <project>
      <modelVersion>4.0.0</modelVersion>
      <groupId>com.stackoverflow</groupId>
      <artifactId>q2488581</artifactId>
      <version>1.0-SNAPSHOT</version>
      <packaging>war</packaging>
      <name>q2488581 Maven Webapp</name>
      <build>
        <plugins>
          <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
            <version>6.1.10</version>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>properties-maven-plugin</artifactId>
            <version>1.0-alpha-2</version>
            <executions>
              <execution>
                <phase>initialize</phase>
                <goals>
                  <goal>read-project-properties</goal>
                </goals>
                <configuration>
                  <files>
                    <file>etc/config/dev.properties</file>
                  </files>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </project>
    

    Running mvn jetty:run-war produces the following output:

    $ mvn jetty:run-war
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Building q2488581 - Maven Webapp
    [INFO]    task-segment: [jetty:run-war]
    [INFO] ------------------------------------------------------------------------
    [INFO] Preparing jetty:run-war
    [INFO] [properties:read-project-properties {execution: default}]
    [INFO] [resources:resources {execution: default-resources}]
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 0 resource
    [INFO] [compiler:compile {execution: default-compile}]
    [INFO] No sources to compile
    [INFO] [resources:testResources {execution: default-testResources}]
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory /home/pascal/Projects/stackoverflow/q2488581/src/test/resources
    [INFO] [compiler:testCompile {execution: default-testCompile}]
    [INFO] No sources to compile
    [INFO] [surefire:test {execution: default-test}]
    [INFO] No tests to run.
    [INFO] [war:war {execution: default-war}]
    [INFO] Packaging webapp
    [INFO] Assembling webapp[q2488581] in [/home/pascal/Projects/stackoverflow/q2488581/target/q2488581]
    [INFO] Processing war project
    [INFO] Copying webapp resources[/home/pascal/Projects/stackoverflow/q2488581/src/main/webapp]
    [INFO] Webapp assembled in[76 msecs]
    [INFO] Building war: /home/pascal/Projects/stackoverflow/q2488581/target/q2488581.war
    [INFO] [jetty:run-war {execution: default-cli}]
    ...
    

    As we can see, properties:read-project-properties is invoked during the initialize phase (before process-resources to which resources:resources is bound) as expected.

    In other words, I cannot reproduce your problem (or maybe you should be more specific).

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

Sidebar

Related Questions

No related questions found

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.