Jasmine Maven plugin including my scripts using file protocol

I am trying to add javascript module testing to our project and found out about Jasmine Maven Plugin . I followed the directions and ended up with this in my pom.xml:

<plugin>
    <groupId>com.github.searls</groupId>
    <artifactId>jasmine-maven-plugin</artifactId>
    <version>1.2.0.0</version>
    <extensions>true</extensions>
    <executions>
        <execution>
            <goals>
                <goal>test</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <jsSrcDir>${project.basedir}/src/main/webapp/resources/js</jsSrcDir>
        <jsTestSrcDir>${project.basedir}/src/test/javascript</jsTestSrcDir>
    </configuration>
</plugin>

I run mvn jasmine:bddand get the expected result. Then I go to http://localhost:8234, and all I get is a blank screen. I look in the console and see this for each of my js files:

Not allowed to load local resource: file:///absolute/path/to/the/js/src/main/webapp/resources/js/myJS.js

The HTML for the page includes my scripts like this:

<script type="text/javascript" src="file:/absolute/path/to/the/js/src/main/webapp/resources/js/myJS.js"></script>

So my question is: why does the plugin use the file protocol for js input? Does it work like usual? If so, how do I get my browser to allow a local resource? Is there any way to prevent this?

Just in case, this is important, I tried it with both Firefox and Chrome, and I use OS X.

+5
1

, , .

, OSX , .

, , , :

C:\directory with spaces\myproject

jasmine:bdd:

C:\directorywithoutspaces\myproject

!

+2

All Articles