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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:33:15+00:00 2026-06-07T00:33:15+00:00

There are nice SO question and answers about this issue, but these options didn’t

  • 0

There are nice SO question and answers about this issue, but these options didn’t work for me.

I want to pass variables to app context:

<bean class="blah.blah.Blah" id="blah">
    <property name="first" value="${first.property}"/>
    <property name="second" value="${second.property}"/>
</bean>

I have the following in the Maven’s settings.xml file:

<profiles>
    <profile>
      <id>profileId</id>
      <activation>
          <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
          <first.property>first value</first.property>
          <second.property>second value</second.property>
      </properties>

I tried this option (which is a bit strange), it gave no results. Than I added this plugin:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <version>1.0-alpha-2</version>
    <executions>
      <execution>
        <phase>process-resources</phase>
        <goals>
          <goal>write-project-properties</goal>
        </goals>
        <configuration>
          <outputFile>
            src/main/resources/maven.properties
          </outputFile>
        </configuration>
      </execution>
    </executions>
</plugin> 

And there wasn’t any maven.properties files in the project afterwards. If I created empty file, nothing appeared in it. And I tried to do repeat these steps with -PprofileId, it didn’t help. Could someone please provide a working code snippet or tell me what do I miss here? Thanks in advance.

Update: I was wrong, properties-maven-plugin works fine.

  • 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-07T00:33:18+00:00Added an answer on June 7, 2026 at 12:33 am

    It’s not clear to me from your question – but if you tried running mvn -PprofileId resources:resources the properties plugin would not run, because the command is executing an individual goal, not a Maven lifecycle phase. What happens if you run mvn -PprofileId process-resources?

    Another question, are any other profiles active? activeByDefault does not mean “always active.” Per Maven docs “All profiles that are active by default are automatically deactivated when a profile in the POM is activated on the command line or through its activation config.” So if you have another profile active, the one with profileId will not be.

    Try removing the activation block from that profile and run mvn -PprofileId process-resources.

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

Sidebar

Related Questions

I know there are many questions and answers about this, but I am looking
In asking a question about reflection I asked: Nice answer. But there is a
I already asked this question but I didn't get my answer. Btw I found
First i would apologize for the question as there are answers out there but
There are way too many questions and answers about this basic functionality, I cannot
Is there a nice way in Ext to move elements in DOM? I want
im currently reading a book about programming Android and there is a nice little
I asked a similar question here a while back but all the answers were
I've seen a couple similar threads to this question, but none of them really
--EDIT-- I believe this is a valid question that may have multiple answers (as

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.