maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shan Syed <shan...@gmail.com>
Subject Re: using javascript dependencies in a webapp (war packaging)
Date Mon, 14 Jun 2010 23:07:09 GMT
I've worked on projects that share common javascript files, so I used a
simple assembly descriptor to zip each set of files and install them as
maven artifacts
WAR projects then just specified them as dependencies in their POMs
it's nice then to be able to treat these artifacts like any other project
(versioned, deployable to a repo, etc)
I used the maven-dependency plugin to unzip them to a standard folder

we didn't require any parsing or compiling of the js, so this worked out
fine for simple packaging and unzipping



On Mon, Jun 14, 2010 at 6:23 PM, Haszlakiewicz, Eric <EHASZLA@transunion.com
> wrote:

>
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message