Packaging war with new gwt maven plugin (having migrated from default maven plugin)

▼魔方 西西 提交于 2019-12-11 08:15:31

问题


I've stated using Thomas Broyer's gwt maven plugin as it allows me to run gwt 2.8-rc2. I've got it running with the codeserver fine and with minimum effort.

However now I'm trying to figure out how to use it to do a full compile and package.

Simply running maven install (I expected this to work as it does work with the default) does not actually run the gwt compile.

Then it talks about various packaging formats etc and I'm not sure why these are necessary?

I assume someone has got this plugin packaging the war and has also migrated from the original plugin...

This is my plugin config - I am using skipModule as I've already got a module configured the way the other plugin expects.

                <plugin>
                    <groupId>net.ltgt.gwt.maven</groupId>
                    <artifactId>gwt-maven-plugin</artifactId>
                    <version>1.0-rc-6</version>
                    <extensions>true</extensions>
                    <configuration>
                        <moduleName>com.afrozaar.ashes.web.AshesWeb-safari</moduleName>
                        <skipModule>true</skipModule>
                        <style>DETAILED</style>
                        <!-- <logLevel>DEBUG</logLevel> -->
                        <classpathScope>compile+runtime</classpathScope>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.google.gwt</groupId>
                            <artifactId>gwt-user</artifactId>
                            <version>2.8.0-rc2</version>
                        </dependency>
                        <dependency>
                            <groupId>com.google.gwt</groupId>
                            <artifactId>gwt-dev</artifactId>
                            <version>2.8.0-rc2</version>
                        </dependency>
                        <dependency>
                            <groupId>com.google.gwt</groupId>
                            <artifactId>gwt-servlet</artifactId>
                            <version>2.8.0-rc2</version>
                        </dependency>
                    </dependencies>
                </plugin>

回答1:


You're missing "executions" in your plugin configuration to run the compile goal (works the same as with the CodeHaus plugin).

My plugin works better when you separate client and server code into distinct Maven modules, which is why this setup is not clearly documented (because I actively discourage it). You can have a look at the samples in the GWT git repository to find examples similar to your case though.

BTW, I believe you can use rc2 with the CodeHaus plugin rc1; that's probably why you added those dependencies, which are useless with my plugin.

See also https://tbroyer.github.io/gwt-maven-plugin/migrating.html



来源:https://stackoverflow.com/questions/39127746/packaging-war-with-new-gwt-maven-plugin-having-migrated-from-default-maven-plug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!