Menu

Maven POM v2.01 from Vaadin architype

2013-04-08
2013-10-23
  • Gregg Sirrine

    Gregg Sirrine - 2013-04-08

    I noticed Vaadin provides a Maven architype for starting new Vaadin projects, so I built a new POM using this architype and updated my project with your 2.01 source. I was able to successfully build the project using the POM below:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>de.steinwedel</groupId>
        <artifactId>MessageBox</artifactId>
        <version>2.0.1</version>
        <name>MessageBox</name>
    
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <vaadin.version>7.0.4</vaadin.version>
            <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
        </properties>
    
        <repositories>
            <repository>
                <id>vaadin-addons</id>
                <url>http://maven.vaadin.com/vaadin-addons</url>
            </repository>
            <repository>
                <id>vaadin-snapshots</id>
                <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
    
        <pluginRepositories>
            <pluginRepository>
                <id>vaadin-snapshots</id>
                <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-server</artifactId>
                <version>${vaadin.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-client-compiled</artifactId>
                <version>${vaadin.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-client</artifactId>
                <version>${vaadin.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-themes</artifactId>
                <version>${vaadin.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
                <version>2.4</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    
        <profiles>
    
            <profile>
                <id>createJavaDocs</id>
                <activation>
                    <activeByDefault>false</activeByDefault>
                </activation>
                <build>
                    <plugins>
    
                        <plugin>
                            <inherited>true</inherited>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <version>2.3.2</version>
                            <configuration>
                                <source>1.6</source>
                                <target>1.6</target>
                                <compilerArguments>
                                    <endorseddirs>lib/</endorseddirs>
                                </compilerArguments>
                            </configuration>
                        </plugin>
    
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>attach-javadocs</id>
                                    <goals>
                                        <goal>jar</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
    
                    </plugins>
                </build>
            </profile>
    
            <profile>
                <id>bundleSource</id>
                <activation>
                    <activeByDefault>false</activeByDefault>
                </activation>
                <build>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-source-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>attach-sources</id>
                                    <goals>
                                        <goal>jar</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </build>
            </profile>
    
        </profiles>
    
    
    
        <build>
            <plugins>
    
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                    </configuration>
                </plugin>
    
                <!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
                <!-- directory is cleaned properly -->
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.4.1</version>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>src/main/webapp/VAADIN/widgetsets</directory>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
    
                <plugin>
                    <groupId>com.vaadin</groupId>
                    <artifactId>vaadin-maven-plugin</artifactId>
                    <version>${vaadin.plugin.version}</version>
                    <configuration>
                        <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                        <!-- <runTarget>mobilemail</runTarget> -->
                        <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This 
                            way compatible with Vaadin eclipse plugin. -->
                        <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
                        </webappDirectory>
                        <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets
                        </hostedWebapp>
                        <noServer>true</noServer>
                        <!-- Remove draftCompile when project is ready -->
                        <draftCompile>false</draftCompile>
                        <compileReport>true</compileReport>
                        <style>OBF</style>
                        <strict>true</strict>
                        <runTarget>http://localhost:8080/</runTarget>
                    </configuration>
                    <executions>
                        <execution>
                            <configuration>
                                <!-- if you don't specify any modules, the plugin will find them -->
                                <!-- <modules> <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module> 
                                    </modules> -->
                            </configuration>
                            <goals>
                                <goal>resources</goal>
                                <goal>update-widgetset</goal>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
    
                <plugin>
                    <groupId>org.mortbay.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
                </plugin>
    
            </plugins>
    
            <pluginManagement>
    
                <plugins>
                    <!--This plugin's configuration is used to store Eclipse m2e settings 
                        only. It has no influence on the Maven build itself. -->
                    <plugin>
                        <groupId>org.eclipse.m2e</groupId>
                        <artifactId>lifecycle-mapping</artifactId>
                        <version>1.0.0</version>
                        <configuration>
                            <lifecycleMappingMetadata>
                                <pluginExecutions>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>com.vaadin</groupId>
                                            <artifactId>
                                                vaadin-maven-plugin
                                            </artifactId>
                                            <versionRange>
                                                [7.0.4,)
                                            </versionRange>
                                            <goals>
                                                <goal>resources</goal>
                                                <goal>update-widgetset</goal>
                                                <goal>compile</goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <ignore></ignore>
                                        </action>
                                    </pluginExecution>
                                </pluginExecutions>
                            </lifecycleMappingMetadata>
                        </configuration>
                    </plugin>
    
                </plugins>
    
            </pluginManagement>
    
        </build>
    
    </project>
    
     
  • Dieter Steinwedel

    Hello Gregg,

    sorry for my late answer. I haven't got a notification mail from sourceforge and I'm looking for the switch to enable it. Therefore it was luck I found your post.

    Thank you for your post! The version 2.x.x is now "mavenized" in the meanwhile. I hope, you enjoy it.

    Best regards,
    Dieter.

     

Anonymous
Anonymous

Add attachments
Cancel