Fork me on GitHub

WebJars Support

Beginning with version 1.3.1.5 the jasmine-maven-plugin supports referencing JavaScript files inside of WebJars via the preloadSources configuration parameter.

Example:

<project>
  ...
  <dependencies>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>jquery</artifactId>
        <version>1.9.0</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.searls</groupId>
        <artifactId>jasmine-maven-plugin</artifactId>
        <version>2.2<version>
        <executions>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <preloadSources>
            <source>webjars/jquery.js</source>
          </preloadSources>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

You can also use a fully qualified reference like this:

Example:

<project>
  ...
  <dependencies>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>jquery</artifactId>
        <version>1.9.0</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.searls</groupId>
        <artifactId>jasmine-maven-plugin</artifactId>
        <version>2.2<version>
        <executions>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <preloadSources>
            <source>webjars/jquery/1.9.0/jquery.js</source>
          </preloadSources>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Or use a general syntax for selecting files from the classpath

Example:

<project>
  ...
  <dependencies>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>jquery</artifactId>
        <version>1.9.0</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.searls</groupId>
        <artifactId>jasmine-maven-plugin</artifactId>
        <version>2.2<version>
        <executions>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <preloadSources>
            <source>classpath/META-INF/resources/webjars/jquery/1.9.0/jquery.js</source>
          </preloadSources>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>