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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:49:40+00:00 2026-06-15T02:49:40+00:00

We are a Scala/Java shop and we use Gradle for our build and Hudson

  • 0

We are a Scala/Java shop and we use Gradle for our build and Hudson for CI. We recently wrote some node.js code with tests in mocha. Is there anyway to get that included in our gradle workflow and setup in Hudson? I looked at the gradle-javascript-plugin but I could not figure out how to run npm test or npm install through it and not sure how to make it run through gradle-build or gradle-test commands and also let Hudson pick it up.

  • 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-15T02:49:41+00:00Added an answer on June 15, 2026 at 2:49 am

    I can get you part of the way there, I am mid-stream on this task as well. Make sure you have at least Gradle 1.2.

    import org.gradle.plugins.javascript.coffeescript.CoffeeScriptCompile
    
    
    apply plugin: 'coffeescript-base'
    
    repositories {
      mavenCentral()
      maven {
        url 'http://repo.gradle.org/gradle/javascript-public'
      }
    }
    
    task compileCoffee(type: CoffeeScriptCompile){
      source fileTree('src')
      destinationDir file('lib')
    }
    

    Reference: http://gradle.1045684.n5.nabble.com/State-of-javascript-stuff-in-master-td5709818.html

    Provided with a way to compile my coffeescript I can now add the npm install cmd into a groovy exec request and barf depending on the exec cmd result providing stdout/stderr

    npm install
    echo $?
    0
    npm install
    npm ERR! install Couldn't read dependencies
    npm ERR! Failed to parse json
    npm ERR! Unexpected token }
    npm ERR! File: /<>/package.json
    npm ERR! Failed to parse package.json data.
    npm ERR! package.json must be actual JSON, not just JavaScript.
    npm ERR! 
    npm ERR! This is not a bug in npm.
    npm ERR! Tell the package author to fix their package.json file. JSON.parse
    
    npm ERR! System Darwin 11.4.2
    npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
    npm ERR! cwd /<>/
    npm ERR! node -v v0.8.14
    npm ERR! npm -v 1.1.65
    npm ERR! file /<>/package.json
    npm ERR! code EJSONPARSE
    npm ERR! 
    npm ERR! Additional logging details can be found in:
    npm ERR!     /<>/npm-debug.log
    npm ERR! not ok code 0
    echo $?
    1
    

    Results in:

    task npmDependencies {
      def proc = 'npm install'.execute()
      proc.in.eachLine { line -> println line}
      proc.err.eachLine { line -> println 'ERROR: '+line }
      proc.waitFor()
      if (proc.exitValue()!=0){
        throw new RuntimeException('NPM dependency installation failed!')
      }
    }
    

    As far as the mocha tests, I don’t have first-hand knowledge of this, however I suspect you can handle similarly.

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

Sidebar

Related Questions

Our company produces a number of Java / Scala libraries for use by our
all. I wrote the following simple code to test scala.actors._: // java version 1.7.0_02
I am converting some Java NIO code to run in Scala and I am
(Yes I know I can call Java code from Scala; but that is pointless;
I have the following code, partly in Java, partly in Scala: Java: public interface
I'd love some advice on how best to autogenerate documentation for a mixed Java/Scala
I need some code samples (and I also really curious about them) of Scala
For a java/scala project I have some dependencies that are not in a remote
what is the equivalent in scala of java's node.getTagName? for instance, if the function
I recently discovered that Java (and Scala) include non-short-circuiting logical operators & , |

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.