Maven Vaadin Plugin problem

Hi,

I have a multi-module maven project. Parent pom looks like this:

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>mygroup</groupId>
    <artifactId>myparent</artifactId>
    <version>${revision}</version>
    <packaging>pom</packaging>

    <modules>
        <module>myejb</module>
        <module>mywar</module>
   </modules>

    <properties>
        <revision>1</revision>
	</properties>
	
	...
</project>

The myejb and mywar project has parent setting like this:

    <parent>
        <groupId>mygroup</groupId>
        <artifactId>myparent</artifactId>
        <version>${revision}</version>
    </parent>

The mywar project is my Vaadin project, so I added Vaadin Plugin settings to mywar/pom.xml like this:

                <plugin>
                        <groupId>com.vaadin</groupId>
                        <artifactId>vaadin-maven-plugin</artifactId>
                        <version>8.9.0</version>
                        <executions>
                                <execution>
                                        <goals>
                                                <goal>resources</goal>
                                                <goal>update-widgetset</goal>
                                                <goal>compile</goal>
                                        </goals>
                                </execution>
                        </executions>
                </plugin>

When I execute mvn vaadin:compile-theme in mywar folder I got this error message:

[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD FAILURE
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Total time:  2.736 s
[INFO]
 Finished at: 2019-10-07T14:37:26+02:00
[INFO]
 ------------------------------------------------------------------------
[ERROR]
 Failed to execute goal on project mywar: Could not resolve dependencies for project mygroup:mywar:war:1: Failed to collect dependencies at mygroup:myejb:jar:1: Failed to read artifact descriptor for mygroup:myejb:jar:1: Could not find artifact mygroup:myparent:pom:${revision} in jboss-eap-repository-group (https://maven.repository.redhat.com/ga/) -> [Help 1]

[ERROR]
 
[ERROR]
 To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR]
 Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
 
[ERROR]
 For more information about the errors and possible solutions, please read the following articles:
[ERROR]
 [Help 1]
 http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

It seems that when execute Vaadin plugin it couldn’t resolve ${revision} property to 1, while it could when handles myejb dependency. Of course in my local repository there are myparent, myejb and mywar with version 1, not ${revision} as Maven build handles this property well.

Could you help me how to solve this problem and execute Vaadin goals in a submodule? Thanks.

When I get the pom snippets correctly, you need to explicitly set the parent’s version in the submodules. Since the revision is defined in the parent the submodules would need to know the correct parent to resolve the correct parent (hen-egg-problem).

Please test if it works, when you set

<parent>
	<groupId>mygroup</groupId>
	<artifactId>myparent</artifactId>
	<version>1</version>
</parent>

instead of

    <parent>
        <groupId>mygroup</groupId>
        <artifactId>myparent</artifactId>
        <version>${revision}</version>
    </parent>

If I follow these instructions and use the Flatten Maven plugin then Vaadin plugin works: https://blog.soebes.de/blog/2017/04/02/maven-pom-files-without-a-version-in-it/