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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:36:24+00:00 2026-06-15T18:36:24+00:00

I am using require-js to model dependencies in my java script project. I also

  • 0

I am using require-js to model dependencies in my java script project. I also use jasmine to write BDD styled test cases and the jasmine-maven-plugin:1.1.0 to execute these tests in headless mode.

This is my source project structure

project/
| src/main/javascript
| | api/*.js
| | main.js
| src/test/javascript
| | spec/*spec.js

This is my webapp pom jasmine configuration:

<plugin>
    <groupId>com.github.searls</groupId>
    <artifactId>jasmine-maven-plugin</artifactId>
    <version>1.1.0</version>
    <executions>
        <execution>
            <goals>
                <goal>generateManualRunner</goal>
                <goal>resources</goal>
                <goal>testResources</goal>
                <goal>test</goal>
                <goal>preparePackage</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <specRunnerTemplate>REQUIRE_JS</specRunnerTemplate>
        <scriptLoaderPath>lib/require-jquery.js</scriptLoaderPath>
        <sourceIncludes>
            <include>lib/require-jquery.js</include>
            <include>lib/underscore.js</include>
            <include>lib/backbone.js</include>
            <include>lib/d3.js</include>
            <include>lib/d3.layout.js</include>
            <include>lib/bootstrap.js</include>
            <include>main.js</include>
        </sourceIncludes>
        <preloadSources>
            <source>lib/require-jquery.js</source>
            <source>lib/underscore.js</source>
            <source>lib/backbone.js</source>
            <source>lib/d3.js</source>
            <source>lib/d3.layout.js</source>
            <source>lib/bootstrap.js</source>
            <source>main.js</source>
        </preloadSources>
        <browserVersion>FIREFOX_3_6</browserVersion>
    </configuration>
</plugin>

During the maven build all js sources are copied to target/jasmine/src. The runner.html that refers to my main.js is at target/jasmine.

Now the problem is that my require-js modules define their dependencies relative to the main.js, whereas in the maven test run, the runner assumes them to be relative to target/jasmine/runner.html. Since my modules are not (and must not be) aware of the additional jasmine/src folder, IMHO that is an issue.

I receive the following error message when I run mvn clean install:

Failed to execute goal
com.github.searls:jasmine-maven-plugin:1.1.0:test (default) on project
mywebapp: The jasmine-maven-plugin encountered an
exception: java.lang.RuntimeException:
org.openqa.selenium.WebDriverException:
com.gargoylesoftware.htmlunit.ScriptException: Wrapped
com.gargoylesoftware.htmlunit.ScriptException: Wrapped
com.gargoylesoftware.htmlunit.ScriptException: Wrapped
com.gargoylesoftware.htmlunit.ScriptException: Wrapped
com.gargoylesoftware.htmlunit.ScriptException: Wrapped
java.lang.RuntimeException: java.io.FileNotFoundException:
C:\Jenkins\jobs\job1\workspace\mywebapp\target\jasmine\api\data-util.js
(The system cannot find the path specified)

Anybody out there having some idea to work around or configure that?

  • 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-15T18:36:26+00:00Added an answer on June 15, 2026 at 6:36 pm

    I faced the same problem:
    java.io.FileNotFoundException

    with requireJS and jasmine

    but you don’t have to use the maven-resources-plugin and hack the js files to a second output directory.

    I used ‘srcDirectoryName’

    you can find all possible params at https://github.com/searls/jasmine-maven-plugin/blob/master/src/main/java/com/github/searls/jasmine/mojo/AbstractJasmineMojo.java

    and advanced examples under https://github.com/searls/jasmine-maven-plugin/tree/master/src/test/resources/examples

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

Sidebar

Related Questions

I'm trying to use a Model-View-Presenter pattern in my Android project. I am using
I'm using Mongoid on Sinatra . And I use Dir.glob(File.join(File.dirname(__FILE__),'models','*.rb')).each do |file| require file
For what purposes are we using Model View Projection Matrix? Why do shaders require
I'm currently implementing a project using asp.net, c# and the MVP (Model-View-Presenter) pattern. The
I am trying to write a unit test for an Action who's model uses
I'm using ruby 1.9 and I'm trying to do BDD. My first test 'should
Model: using System.ComponentModel.DataAnnotations; using MySite.Validators; namespace MySite.Models { public class AddItem { [Required(ErrorMessage =
Using Require.js and it works pretty solid. However, I'm reading about optimization (http://requirejs.org/docs/optimization.html) using
Am using require.js to load backbone, and my other scripts, but i get an
I have found that I have no problem using require to load something like

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.