maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Haszlakiewicz, Eric" <EHAS...@transunion.com>
Subject using javascript dependencies in a webapp (war packaging)
Date Mon, 14 Jun 2010 22:23:15 GMT

I've got a webapp that uses javascript files from third party projects.
For instance, one of the files we use is prototype.js.  It seems like
this must be something that many people have done in the past, but I
can't seem to find much information about it.

The first issue I have is that I can't seem to find a maven repository
that has this file (or any of the other javascript scripts I use).  Is
there one?

Since I couldn't find one, I uploaded a copy to my local repository
(Nexus) using:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.prototypejs</groupId>
	<artifactId>prototype</artifactId>
	<version>1.6.1</version>
	<packaging>js</packaging>
	<url>http://prototypejs.org/assets/2009/8/31/prototype.js</url>
</project>

and I then added an entry to the pom for my webapp:
        <dependency>
            <groupId>org.prototypejs</groupId>
            <artifactId>prototype</artifactId>
            <type>js</type>
            <version>1.6.1</version>
        </dependency>


but I can't figure out how to get this to actually get included into the
war file.  I tried configuring an overlay, but it doesn't seem to do
anything:
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <overlays>
            <overlay>
              <groupId>org.prototypejs</groupId>
              <artifactId>prototype</artifactId>
              <type>js</type>
              <targetPath>common/javascript</targetPath>
            </overlay>
          </overlays>
        </configuration>
       </plugin>

All I see is a warning when I run "mvn package":
[WARNING] Skip unpacking dependency
file[/u/ehaszla/.m2/repository/org/prototypejs/prototype/1.6.1/prototype
-1.6.1.js with unknown extension[js]

I want to end up with a file called "prototype-1.6.1.js" in the
"common/javascript" directory within the war file.

How do I get this to work?

eric

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message