In case anyone else is trying to bundle js source files in a reusable
jar with maven, here are the steps involved that worked for me:
1. Create a new gwt web application or Java project that uses gwt kit.
2. Add a folder named 'public' to your package and copy the javascript
source files into this location.
3. In your Module.gwt.xml add the source path and a script for each
javascript source file.
<source path='public'/>
<script src="sourcefile.js"/>
You should have the following structure:
com/packagename
----->Module.gwt.xml
----->/client
----------->Module.java
----->/public
----------->jssource.js
4. Create a maven pom. Add the following dependency:
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
5. Run mvn clean install
6. Add the jar to your main project's build path
7. Open your main app gwt.xml module and inherit the module in the
jar:
<inherits name="com.packagename.Module" />
The js source should be available to your main app.
.b
On Apr 4, 10:59 pm, beowulf5 <[email protected]> wrote:
> Hello Team.
>
> I need to include a javascript library which was packaged as a Maven
> project.
>
> What are my options for including the js library artifact in GWT?
>
> Is there a way to create a client bundle for this?
>
> Originally I had planned to create an overlay class to handle
> communication between the GWT app and the client library.
>
> Any advice or help is appreciated.
>
> Kind regards.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.