Maven doesnt add *.gwt.xml file to target floder

I am trying to build spring+gwt project with the next properties:

    <groupId>ru.beleychev</groupId>
<artifactId>notes</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<name>notes</name>
<description>Project for resume</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.4.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-rest</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-taglibs</artifactId>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-springsecurity4</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <!--GWT-->
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>2.8.1</version>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-servlet</artifactId>
        <version>2.8.1</version>
    </dependency>
</dependencies>

<build>
    <finalName>${project.artifactId}</finalName>
    <outputDirectory>target/${project.artifactId}/WEB-INF/classes</outputDirectory>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>2.8.1</version>
            <executions>
                <execution>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>compile</goal>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>${maven.compiler.source}</source>
                <target>${maven.compiler.target}</target>
            </configuration>
        </plugin>
    </plugins>
</build>

The thing is that after building i cant find NotesGwtApp.gwt.xml file :) There are 2 pictures for better understanding. What is going on?

Output structure Project structure

I really dont understand why is that...

Upvotes: 2

Views: 259

Answers (1)

Andrei
Andrei

Reputation: 1635

The behavior you're seeing is standard for Maven. It is because Maven, by default, only looks for .java files in the src/main/java folder, while some tools might include all files by default, and hence the confusion.

You need to tell Maven that you also have non-java resources in your src/main/java folder; you might want to add a piece of config such as:

    <resources>
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*</include>
            </includes>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
    </resources>

Upvotes: 3

Related Questions