0
votes

first of all, I'm not sure which folders and files i have to deploy in a gwt-maven project I've got: .gwt .settings bin src/main/java target war pom.xml

I'm pretty sure, I've to deploy the pom.xml somehow and the target folder. But my target folder doesn't contain a pom.xml which I need for deploying on a jetty server

Second: I've installed maven on my webserver, but apart from embedding the jetty-maven-plugin in the pom.xml (by org.eclipse.jetty jetty-maven-plugin ) I have absolutely no clue how to get this project running on a jetty server.

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 SiedlerVonCatanC SiedlerVonCatanC war src/main/java src/main/java */.java maven-compiler-plugin 3.1 1.7 1.7

        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>2.5.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <module>main.java.de.swp.catan.SiedlerVonCatanC</module>
                        <runTarget>SiedlerVonCatanC.html</runTarget>
                        <hostedWebapp>${webappDirectory}</hostedWebapp>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
<dependencies>
    <!-- GWT -->
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-servlet</artifactId>
        <version>2.5.1</version>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>2.5.1</version>
    </dependency>
    <!-- SmartGWT -->
    <dependency>
        <groupId>com.smartgwt</groupId>
        <artifactId>smartgwt</artifactId>
        <version>3.0</version>
    </dependency>
    <!-- Event Service -->
    <dependency>
        <groupId>de.novanic.gwteventservice</groupId>
        <artifactId>gwteventservice</artifactId>
        <version>1.2.0</version>
    </dependency>

    <!-- Java-Mail -->
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4</version>
    </dependency>

    <!-- Apache Commons -->
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.3</version>
    </dependency>

    <!-- htmlunit (wird im Projekt irgendwo genutzt) -->
    <!-- <dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit</artifactId> 
        <version>2.4</version> </dependency> -->

    <!-- Guice -->
    <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>3.0</version>
    </dependency>

    <!-- Connector for JDBC -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.25</version>
    </dependency>
</dependencies>
<repositories>
    <repository>
        <id>com.smartgwt</id>
        <url>http://www.smartclient.com/maven2</url>
    </repository>
</repositories>
<version>0.2</version>

2
Can you explain what you mean by "deploy in a gwt-maven project". Do you mean to build a war and push it to a jetty instance running somewhere? - appbootup
I want to push it to a remote server. It doesn't have to be a war-file. - Frauke
Is jetty instance already running there or you need to stop the running one and start another one everytime? - appbootup

2 Answers

0
votes

have the maven-jetty-plugin included in your pom , under plugins and then you can run it as

     mvn jetty:run

thanks

0
votes

If you want to use maven plugin to run embedded jetty for development then easy way using command-line (which I recommend for start) is:

Edit: Please note this is not related to the existing project.Its process from scratch. Just run these command from a new directory where you would like a new gwt project to be created.

  • Dowload gwt maven plugin http://mojo.codehaus.org/gwt-maven-plugin/. In command line list you can see it as org.codehaus.mojo:gwt-maven-plugin (Maven plugin for the Google Web Toolkit.) I see that you have this plugin in POM, but if you are at loss here the simple steps from command-line to achive this are:

    1. mvn archetype:generate
    2. enter org.codehaus.mojo:gwt-maven-plugin in search prompt
    3. comfirm the resutl with enter
    4. set-up the maven project configuration as prompted
  • run the project with mvn gwt:run from the folder where you have pom.xml

These two steps will run a sample project for you which you can further modify and experiment while learning how it works.,

As for directories: The maven compiles all your stuff in target directory and that is used for deployment or running embedded jetty.