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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:51:33+00:00 2026-05-26T10:51:33+00:00

Why does Maven insist on treating empty strings and strings of spaces null values?

  • 0

Why does Maven insist on treating empty strings and strings of spaces “null values”? Take the following pom – I get the usual bogus message about a misconfigured argument. How can I arrange to pass an empty value that Maven will actually recognize as such instead of tormenting me with absurd error messages?

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Misconfigured argument, value is null. Set the argument to an empty value if this is the required behaviour.

pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.test</groupId>
    <artifactId>test</artifactId>
    <packaging>pom</packaging>
    <version>0</version>
    <name>test</name>
    <url>http://maven.apache.org</url>
    <properties>
        <my.val>             </my.val>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <id>Exec test</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>${env.JAVA_HOME}/bin/java</executable>
                            <arguments>
                                <argument>${my.val}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
  • 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-26T10:51:34+00:00Added an answer on May 26, 2026 at 10:51 am

    Looks like the problem has been known since 2007 -> http://mail-archives.apache.org/mod_mbox/maven-users/200708.mbox/%3C5a2cf1f60708090246l216f156esf46cc1e968b37ccd@mail.gmail.com%3E

    In your case you may try to use <commanlineArgs> configuration parameter instead.

    It’s not pretty if you have many arguments, but if you only have one or two it may be an option.

    <configuration>
      <executable>${env.JAVA_HOME}/bin/java</executable>
      <commandlineArgs>${my.val}</commandlineArgs>
    </configuration>
    

    I’ve also created a bug report in MEXEC Jira: http://jira.codehaus.org/browse/MEXEC-104

    UPDATE

    To supply a classpath through <commandlineArgs>, do this:

    <commandlineArgs>-classpath %classpath my.main.class.MyMainClass ${my.val}</commandlineArgs>
    

    Actually, the parser even allows folding of the long line to make it more readable, e.g.

    <commandlineArgs>
      -classpath %classpath
      my.main.class.MyMainClass
      ${my.val}
    </commandlineArgs>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got three questions here. First, does pom.xml of maven have any difference from
Why does maven download dependencies when I run mvn clean ? can I turn
What is an artifact and why does Maven need it?
Maven 2 does not seem to consider my @Test and @Ignore annotations. How do
Does anyone know how to read a x.properties file in Maven. I know there
Does anyone have any idea if you can find source JARs on Maven repositories?
does anyone knows how do I specify in Ivy something like mirror/mirrorOf in Maven?
Why does every time I do mvn jetty:run, maven tries to download some dependencies
I am new to Maven My question is where does maven download the external
In my Maven build I would like to be able to define default values

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.