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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:10:23+00:00 2026-06-17T12:10:23+00:00

I am migrating one java project into Maven and we are using Appassembler maven

  • 0

I am migrating one java project into Maven and we are using Appassembler maven plugin (version 1.3) for generating shell start script. My problem is how to redirect stdout and/or output of java program? This Appassembler’s pom.xml configuration

        <program>
          <mainClass>com.mycompany.app.App</mainClass>
          <commandLineArguments>
            <commandLineArgument>arg1</commandLineArgument>
            <commandLineArgument>arg2</commandLineArgument>
          </commandLineArguments>
          <name>app</name>
        </program>

generates:

exec "$JAVACMD" $JAVA_OPTS \
  $EXTRA_JVM_ARGUMENTS \
  -classpath "$CLASSPATH" \
  -Dapp.name="app" \
  -Dapp.pid="$$" \
  -Dapp.repo="$REPO" \
  -Dbasedir="$BASEDIR" \
  com.mycompany.app.App \
  arg1 arg2 "$@"

Parameters placeholder ($@) is the last generated token in the start script.

  • 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-17T12:10:24+00:00Added an answer on June 17, 2026 at 12:10 pm

    Found a workaround on this problem. Fortunately the parameters placeholder is on the same line as generated command line arguments. So this pom.xml configuration:

    <commandLineArguments>
        <commandLineArgument>"$@"</commandLineArgument>
        <commandLineArgument>&gt;&gt;out.log</commandLineArgument>
        <commandLineArgument>2&gt;&amp;1</commandLineArgument>
        <commandLineArgument>#</commandLineArgument>
    </commandLineArguments>
    

    will generate the script:

    ....
    com.mycompany.app.App \
    "$@" >>out.log 2>&1 # "$@"
    

    Hash is comment in bash so the last parameter placeholder will be ignored and this hack will do the redirecting job.

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

Sidebar

Related Questions

I'm working on migrating a textile plugin for a java blogging platform from one
First Post. I'm a mobile game developer looking into using the Java version of
We're in process of migrating one stable project from Castle Windsor 2.5.2 to 3.0.
We're migrating from one server to another and a VBA script to save attachments
I am migrating data from one model version to another in the iPhone, but
I have been working on migrating our code base onto Glassfish 3.1.2 using Java
I'm trying to migrating a gwt-project to maven for a couple of days, but
I'm migrating a couple of projects from an ant build to a maven one.
Are there tools for migrating from one virtual machine type to another? E.g let's
Hi can any one suggest tool for migrating from TFS to TFS preferred Open

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.