Skip to content

Commit 500bab1

Browse files
committed
Merge branch 'master' into update-from-template-merged
2 parents 37e12e8 + 7124d0d commit 500bab1

File tree

13 files changed

+291
-38
lines changed

13 files changed

+291
-38
lines changed

Diff for: .github/workflows/check-build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
cache: 'maven'
4545

4646
- name: Build with Maven
47-
run: ./mvnw -B clean package
47+
run: ./mvnw -B clean package -Pproduction
4848

4949
- name: Check for uncommited changes
5050
run: |
@@ -60,7 +60,7 @@ jobs:
6060
echo ----------------------------------------
6161
echo Troubleshooting
6262
echo ----------------------------------------
63-
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package"
63+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package -Pproduction"
6464
exit 1
6565
fi
6666

Diff for: .github/workflows/release.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
cache: 'maven'
2727

2828
- name: Build with Maven
29-
run: ./mvnw -B clean package
29+
run: ./mvnw -B clean package -Pproduction
3030

3131
- name: Check for uncommited changes
3232
run: |
@@ -42,7 +42,7 @@ jobs:
4242
echo ----------------------------------------
4343
echo Troubleshooting
4444
echo ----------------------------------------
45-
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package"
45+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package -Pproduction"
4646
exit 1
4747
fi
4848
@@ -108,6 +108,9 @@ jobs:
108108
</dependency>
109109
```
110110
111+
### Additional notes
112+
* [Spring-Boot] You may have to include ``software/xdev`` inside [``vaadin.allowed-packages``](https://vaadin.com/docs/latest/integrations/spring/configuration#configure-the-scanning-of-packages)
113+
111114
publish-maven:
112115
runs-on: ubuntu-latest
113116
needs: [prepare-release]

Diff for: .github/workflows/update-from-template.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
env:
2222
UPDATE_BRANCH: update-from-template
2323
UPDATE_BRANCH_MERGED: update-from-template-merged
24-
REMOTE_URL: https://github.com/xdev-software/standard-maven-template.git
24+
REMOTE_URL: https://github.com/xdev-software/vaadin-addon-template.git
2525
REMOTE_BRANCH: master
2626

2727
permissions:

Diff for: .gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,29 @@ hs_err_pid*
5757
/*/.project
5858
/*/RemoteSystemsTempFiles/
5959

60+
61+
#vaadin/node webpack/frontend stuff
62+
# Ignore Node
63+
node/
64+
65+
# The following files are generated/updated by vaadin-maven-plugin
66+
node_modules/
67+
68+
# Vaadin
69+
package.json
70+
package-lock.json
71+
webpack.generated.js
72+
webpack.config.js
73+
tsconfig.json
74+
types.d.ts
75+
vite.config.ts
76+
vite.generated.ts
77+
/*/src/main/frontend/generated/
78+
/*/src/main/frontend/index.html
79+
/*/src/main/dev-bundle/
80+
/*/src/main/bundles/
81+
*.lock
82+
6083
#custom
6184
.flattened-pom.xml
6285
.tern-project

Diff for: .run/Run Demo.run.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
3-
<option name="MAIN_CLASS_NAME" value="software.xdev.Application" />
3+
<option name="MAIN_CLASS_NAME" value="software.xdev.vaadin.Application" />
44
<module name="template-placeholder-demo" />
55
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
66
<extension name="coverage">
77
<pattern>
8-
<option name="PATTERN" value="software.xdev.*" />
8+
<option name="PATTERN" value="software.xdev.vaadin.*" />
99
<option name="ENABLED" value="true" />
1010
</pattern>
1111
</extension>

Diff for: CONTRIBUTING.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,20 @@ You should have the following things installed:
3232
* Import the project
3333
* Ensure that everything is encoded in ``UTF-8``
3434
* Ensure that the JDK/Java-Version is correct
35-
35+
* To enable AUTOMATIC reloading/restarting while developing and running the app do this (further information in "
36+
SpringBoot-Devtools" section below; [Source](https://stackoverflow.com/q/33349456)):
37+
* ``Settings > Build, Execution, Deployment > Compiler``:<br/>
38+
Enable [``Build project automatically``](https://www.jetbrains.com/help/idea/compiling-applications.html#auto-build)
39+
* ``Settings > Advanced Settings``:<br/>
40+
Enable [``Allow auto-make to start even if developed application is currently running``](https://www.jetbrains.com/help/idea/advanced-settings.html#advanced_compiler)
41+
* To launch the Demo execute the predefined (launch) configuration ``Run Demo``
42+
43+
#### [SpringBoot-Developer-Tools](https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.devtools)
44+
... should automatically be enabled.<br/>
45+
If you are changing a file and build the project, parts of the app get restarted.<br/>
46+
Bigger changes may require a complete restart.
47+
* [Vaadin automatically reloads the UI on each restart](https://vaadin.com/docs/latest/configuration/live-reload/spring-boot).<br/>
48+
You can control this behavior with the ``vaadin.devmode.liveReload.enabled`` property (default: ``true``).
3649

3750
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/release.yml?branch=master)](https://github.com/xdev-software/template-placeholder/actions/workflows/release.yml)
3851

@@ -44,6 +57,7 @@ If the ``develop`` is ready for release, create a pull request to the ``master``
4457

4558
When the release is finished do the following:
4659
* Merge the auto-generated PR (with the incremented version number) back into the ``develop``
60+
* Ensure that [Vaadin Directory](https://vaadin.com/directory) syncs the update and maybe update the component / version there
4761

4862
### Release failures
4963

Diff for: README.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1+
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0?logo=vaadin)](https://vaadin.com/directory/component/template-placeholder)
12
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder)
23
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop)
34
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder)
5+
![Vaadin 24+](https://img.shields.io/badge/Vaadin%20Platform/Flow-24+-00b4f0)
46

57
# template-placeholder
8+
A Vaadin Template Repo
9+
10+
![demo](assets/demo.png)
611

712

813
## Installation
914
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
1015

16+
## Run the Demo
17+
* Checkout the repo
18+
* Run ``mvn install && mvn -f template-placeholder-demo spring-boot:run``
19+
* Open http://localhost:8080
20+
21+
<details>
22+
<summary>Show example</summary>
23+
24+
![demo](assets/demo.avif)
25+
</details>
26+
1127
## Support
1228
If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).
1329

Diff for: assets/demo.avif

1.4 KB
Binary file not shown.

Diff for: assets/demo.png

13.9 KB
Loading

Diff for: template-placeholder-demo/pom.xml

+135-29
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,103 @@
2626
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2727
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2828

29-
<mainClass>software.xdev.Application</mainClass>
29+
<mainClass>software.xdev.vaadin.Application</mainClass>
30+
31+
<!-- Dependency-Versions -->
32+
<vaadin.version>24.6.2</vaadin.version>
33+
34+
<org.springframework.boot.version>3.4.2</org.springframework.boot.version>
3035
</properties>
3136

37+
<dependencyManagement>
38+
<dependencies>
39+
<dependency>
40+
<groupId>com.vaadin</groupId>
41+
<artifactId>vaadin-bom</artifactId>
42+
<type>pom</type>
43+
<scope>import</scope>
44+
<version>${vaadin.version}</version>
45+
</dependency>
46+
47+
<!-- Spring Boot -->
48+
<!-- This bom provides versions for ~500 dependencies -->
49+
<!-- Nearly at the end so that it doesn't accidentally overwrite other versions -->
50+
<dependency>
51+
<groupId>org.springframework.boot</groupId>
52+
<artifactId>spring-boot-dependencies</artifactId>
53+
<version>${org.springframework.boot.version}</version>
54+
<type>pom</type>
55+
<scope>import</scope>
56+
</dependency>
57+
</dependencies>
58+
</dependencyManagement>
59+
3260
<dependencies>
61+
<dependency>
62+
<groupId>com.vaadin</groupId>
63+
<artifactId>vaadin-core</artifactId>
64+
<exclusions>
65+
<exclusion>
66+
<groupId>com.vaadin</groupId>
67+
<artifactId>hilla-dev</artifactId>
68+
</exclusion>
69+
</exclusions>
70+
</dependency>
3371
<dependency>
3472
<groupId>software.xdev</groupId>
3573
<artifactId>template-placeholder</artifactId>
3674
<version>${project.version}</version>
3775
</dependency>
76+
77+
<!-- Spring -->
78+
<dependency>
79+
<groupId>com.vaadin</groupId>
80+
<artifactId>vaadin-spring-boot-starter</artifactId>
81+
<exclusions>
82+
<exclusion>
83+
<groupId>com.vaadin</groupId>
84+
<artifactId>hilla</artifactId>
85+
</exclusion>
86+
</exclusions>
87+
</dependency>
88+
<!-- Temporarily excluded by Vaadin due to "security vulnerability" -->
89+
<dependency>
90+
<groupId>org.yaml</groupId>
91+
<artifactId>snakeyaml</artifactId>
92+
</dependency>
93+
<dependency>
94+
<groupId>org.springframework.boot</groupId>
95+
<artifactId>spring-boot-devtools</artifactId>
96+
<optional>true</optional>
97+
</dependency>
3898
</dependencies>
3999

40100
<build>
41101
<finalName>${project.artifactId}</finalName>
102+
103+
<pluginManagement>
104+
<plugins>
105+
<plugin>
106+
<groupId>org.springframework.boot</groupId>
107+
<artifactId>spring-boot-maven-plugin</artifactId>
108+
<version>${org.springframework.boot.version}</version>
109+
</plugin>
110+
</plugins>
111+
</pluginManagement>
42112

43113
<plugins>
114+
<plugin>
115+
<groupId>com.vaadin</groupId>
116+
<artifactId>vaadin-maven-plugin</artifactId>
117+
<version>${vaadin.version}</version>
118+
<executions>
119+
<execution>
120+
<goals>
121+
<goal>prepare-frontend</goal>
122+
</goals>
123+
</execution>
124+
</executions>
125+
</plugin>
44126
<plugin>
45127
<groupId>org.apache.maven.plugins</groupId>
46128
<artifactId>maven-compiler-plugin</artifactId>
@@ -52,34 +134,58 @@
52134
</compilerArgs>
53135
</configuration>
54136
</plugin>
55-
<plugin>
56-
<groupId>org.apache.maven.plugins</groupId>
57-
<artifactId>maven-assembly-plugin</artifactId>
58-
<version>3.7.1</version>
59-
<configuration>
60-
<archive>
61-
<manifest>
62-
<mainClass>${mainClass}</mainClass>
63-
</manifest>
64-
<manifestEntries>
65-
<Multi-Release>true</Multi-Release>
66-
</manifestEntries>
67-
</archive>
68-
<descriptorRefs>
69-
<descriptorRef>jar-with-dependencies</descriptorRef>
70-
</descriptorRefs>
71-
<appendAssemblyId>false</appendAssemblyId>
72-
</configuration>
73-
<executions>
74-
<execution>
75-
<id>make-assembly</id> <!-- this is used for inheritance merges -->
76-
<phase>package</phase> <!-- bind to the packaging phase -->
77-
<goals>
78-
<goal>single</goal>
79-
</goals>
80-
</execution>
81-
</executions>
82-
</plugin>
83137
</plugins>
84138
</build>
139+
140+
<profiles>
141+
<profile>
142+
<id>production</id>
143+
<dependencies>
144+
<!-- Exclude development dependencies from production -->
145+
<dependency>
146+
<groupId>com.vaadin</groupId>
147+
<artifactId>vaadin-core</artifactId>
148+
<exclusions>
149+
<exclusion>
150+
<groupId>com.vaadin</groupId>
151+
<artifactId>vaadin-dev</artifactId>
152+
</exclusion>
153+
</exclusions>
154+
</dependency>
155+
</dependencies>
156+
<build>
157+
<plugins>
158+
<plugin>
159+
<groupId>com.vaadin</groupId>
160+
<artifactId>vaadin-maven-plugin</artifactId>
161+
<version>${vaadin.version}</version>
162+
<executions>
163+
<execution>
164+
<goals>
165+
<goal>prepare-frontend</goal>
166+
<goal>build-frontend</goal>
167+
</goals>
168+
</execution>
169+
</executions>
170+
</plugin>
171+
<plugin>
172+
<groupId>org.springframework.boot</groupId>
173+
<artifactId>spring-boot-maven-plugin</artifactId>
174+
<configuration>
175+
<mainClass>${mainClass}</mainClass>
176+
</configuration>
177+
<executions>
178+
<execution>
179+
<id>repackage</id>
180+
<goals>
181+
<goal>repackage</goal>
182+
</goals>
183+
<phase>package</phase>
184+
</execution>
185+
</executions>
186+
</plugin>
187+
</plugins>
188+
</build>
189+
</profile>
190+
</profiles>
85191
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package software.xdev.vaadin;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
6+
7+
import com.vaadin.flow.component.page.AppShellConfigurator;
8+
import com.vaadin.flow.component.page.Push;
9+
import com.vaadin.flow.spring.annotation.EnableVaadin;
10+
11+
12+
@SpringBootApplication
13+
@EnableVaadin
14+
@Push
15+
public class Application extends SpringBootServletInitializer implements AppShellConfigurator
16+
{
17+
public static void main(final String[] args)
18+
{
19+
SpringApplication.run(Application.class, args);
20+
}
21+
}
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
vaadin:
2+
allowed-packages: software/xdev,com/vaadin/flow
3+
4+
spring:
5+
devtools:
6+
restart:
7+
poll-interval: 2s
8+
quiet-period: 1s

0 commit comments

Comments
 (0)