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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:49:41+00:00 2026-06-18T22:49:41+00:00

We’re using exec-maven-plugin to run RequireJS’s optimizer (r.js) under Node.js (because it’s a lot

  • 0

We’re using exec-maven-plugin to run RequireJS’s optimizer (r.js) under Node.js (because it’s a lot faster than Rhino):

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2</version>
    <executions>
        <execution>
            <id>compile-js</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>exec</goal>
            </goals>
            <configuration>
                <executable>${node.executable}</executable>
                <arguments>
                    <argument>${project.build.directory}/dependency/requirejs/r.js</argument>
                    <argument>-o</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

The issue is, whenever there’s any issue during compilation, the error messages that r.js is supposed to blurt out are not shown in Maven’s console output. What I do to troubleshoot is, I rerun the Maven command with the -X flag to get debug output so that exec-maven-plugin outputs the actual command being executed. It’s something like:

project-root/target/dependency/node/node \
    project-root/target/dependency/requirejs/r.js \
    -o src/main/webapp/app.build.json

When I run the command manually from the command line, I then get the actual compilation errors in the console and then proceed to fixing them.

I’ve experimented with redirecting stderr to stdout with 2>&1 to no avail (on Windows) because I couldn’t immediately find a way to make exec-maven-plugin like the redirection bit as an argument. I didn’t pursue that route too far because it’s just a wild guess that this is a stderr/stdout issue — it could be, but I’m merely speculating.

Any pointers to as to what may be happening, or any suggestions for further diagnostic steps that I can take? Please remember there are multiple moving parts in this problem: Maven, exec-maven-plugin, Node.js, r.js, and one tired head.

P.S. I’m considering giving requirejs-maven-plugin a shot as a last resort because the project timeline doesn’t allow me to do a complete overhaul of the POM right now. I’m trying to see if there’s anything I can do with the current setup.

  • 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-18T22:49:42+00:00Added an answer on June 18, 2026 at 10:49 pm

    How about wrapping the call to node.js and r.js in a script, that you then call from the maven-exec plugin?

    From a look at r.js, it seems to use console.log for it’s output. Maybe running it from a shell script will allow you to catch the output, pipe it into a file, regex for an errors, etc.

    Depending on the OS, this might be easy to do.

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

Sidebar

Related Questions

I am using JSon response to parse title,date content and thumbnail images and place
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to run a str_replace or preg_replace which looks for certain words
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.