Andris
(Andris Lapinsh)
October 11, 2024, 9:34am
1
Hello.
According to latest documentation https://vaadin.com/docs/latest/flow/production/production-build#excluding-development-server-module to exclude development server module I have to add in production profile:
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-dev</artifactId>
</exclusion>
</exclusions>
But this module still gets into the assembly. Is this how it should be?
OnDemand
(Nico M)
October 11, 2024, 9:55am
2
How does your maven promt looks like for building productive?
Andris
(Andris Lapinsh)
October 11, 2024, 9:59am
3
It is command line which executed:
cd C:\work\online; JAVA_HOME=C:\\jdk-17 cmd /c "\".\\mvnw.cmd\" -DskipTests=true -Dmaven.ext.class.path=C:\\dev\\netbeans23\\java\\maven-nblib\\netbeans-eventspy.jar -Dmaven.javadoc.skip=true -Pproduction clean install"
marcoc_753
(Marco Collovati)
October 11, 2024, 10:10am
4
Try to run
mvn dependency:tree -Pproduction -Dincludes=com.vaadin:vaadin-dev
and check which artifact has a dependency to vaadin-dev
.
Andris
(Andris Lapinsh)
October 11, 2024, 10:25am
5
This is result:
[INFO] org.mycompany:online:war:1.0-SNAPSHOT
[INFO] \- com.vaadin:vaadin-core:jar:24.4.13:compile
[INFO] \- com.vaadin:vaadin-dev:jar:24.4.13:compile
marcoc_753
(Marco Collovati)
October 11, 2024, 10:30am
6
The documentation assumes the project has a com.vaadin:vaadin
dependency, but in you have com.vaadin:vaadin-core
because you are not using commercial components.
Just add the exclusion to that vaadin-core
Andris
(Andris Lapinsh)
October 11, 2024, 10:38am
7
That’s exactly what I have. My production profile:
<profile>
<id>production</id>
<properties>
<log.file>online.log</log.file>
<log.level>INFO</log.level>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>clean-frontend</goal>
<goal>build-frontend</goal>
</goals>
</execution>
</executions>
<configuration>
<productionMode>true</productionMode>
</configuration>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
<version>${vaadin.version}</version>
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-dev</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
marcoc_753
(Marco Collovati)
October 11, 2024, 10:41am
8
The dependency should be defined at the profile level, not as a plugin configuration.
If you look at the example in the documentation there is this comment
<!-- above production build configuration -->
<profile>
<id>production</id>
<properties>
<log.file>online.log</log.file>
<log.level>INFO</log.level>
</properties>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-dev</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build> ..... </build>
1 Like
Andris
(Andris Lapinsh)
October 11, 2024, 10:57am
9
Thanks Marco! You are right, my mistake. Tough week.
1 Like