Giter Site home page Giter Site logo

Web fragment support about gwt-maven-plugin HOT 3 CLOSED

tbroyer avatar tbroyer commented on May 24, 2024
Web fragment support

from gwt-maven-plugin.

Comments (3)

foal avatar foal commented on May 24, 2024

Ok. As workaround I use the following configuration for my project. The configuration for maven-jar-plugin is necessary because the compilation result includes the /gwt and /get-units foldes that are relative big

<packaging>gwt-lib</packaging>

...

 <build>
        <plugins>
            <plugin>
                <groupId>net.ltgt.gwt.maven</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>1.0-rc-3</version>
                <extensions>true</extensions>
                <configuration>
                    <moduleName>org.jresearch.logbackui.gwt.fragment.module</moduleName>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <webappDirectory>${project.build.directory}/classes/META-INF/resources</webappDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/META-INF/gwt*/*</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

from gwt-maven-plugin.

tbroyer avatar tbroyer commented on May 24, 2024

Your workaround would package all your sources and compiled Java classes too in the JAR, so I'd have rather compiled to some directory separate from ${project.build.outputDirectory} (equivalent to the ${project.build.directory}/classes you used) and configured that directory as the classesDirectory for the maven-jar-plugin.

<plugin>
    <groupId>net.ltgt.gwt.maven</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <version>1.0-rc-3</version>
    <extensions>true</extensions>
    <configuration>
        <moduleName>org.jresearch.logbackui.gwt.fragment.module</moduleName>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
            </goals>
            <configuration>
                <webappDirectory>${project.build.directory}/${project.build.finalName}/META-INF/resources</webappDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
        <classesDirectory>${project.build.directory}/${project.build.finalName}</classesDirectory>
    </configuration>
</plugin>

You should be able to move the gwt-unitCache dir using:

<systemProperties>
  <gwt.persistentunitcachedir>${project.build.directory}/gwt/unitCache/</gwt.persistentunitcachedir>
</systemProperties>

No idea where the gwt folder is coming from though…

An alternative is to use a distinct Maven module that would depend on the gwt-app module and use dependency:unpack to "repackage" it as web fragment in a JAR.
That actually feels much cleaner.

Anyway, that's an interesting proposal, and maybe the gwt-app packaging should enable generating a JAR instead of, or in addition to, the WAR, with just a boolean property. I don't think this should be the default though (nor that it warrants a new packaging type). JsInterop will make it easier to create JS libs though, and it might make sense to create a gwt-jslib packaging type then, but I'd rather wait for GWT 3.0, as building JS libs from GWT still isn't a common use case with GWT 2.x and JsInterop isn't there yet (soon, but not yet).

from gwt-maven-plugin.

tbroyer avatar tbroyer commented on May 24, 2024

I think using an additional module to turn the gwt-app into a web-fragment jar is the best solution; otherwise Maven is likely to cause issues with dependencies being transitive (and as a result including client-side dependencies into the webapp's WEB-INF/lib alongside the web-fragment JAR)

from gwt-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.