Skip to content

Commit

Permalink
Merge branch 'master' into update-from-template-merged
Browse files Browse the repository at this point in the history
  • Loading branch information
xdev-gh-bot committed Sep 20, 2024
2 parents eff887a + 9a88197 commit 2f10b25
Show file tree
Hide file tree
Showing 13 changed files with 279 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
cache: 'maven'

- name: Build with Maven
run: ./mvnw -B clean package
run: ./mvnw -B clean package -Pproduction

- name: Check for uncommited changes
run: |
Expand All @@ -59,7 +59,7 @@ jobs:
echo ----------------------------------------
echo Troubleshooting
echo ----------------------------------------
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package"
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package -Pproduction"
exit 1
fi
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cache: 'maven'

- name: Build with Maven
run: ./mvnw -B clean package
run: ./mvnw -B clean package -Pproduction

- name: Check for uncommited changes
run: |
Expand All @@ -41,7 +41,7 @@ jobs:
echo ----------------------------------------
echo Troubleshooting
echo ----------------------------------------
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package"
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package -Pproduction"
exit 1
fi
Expand Down Expand Up @@ -106,6 +106,9 @@ jobs:
</dependency>
```
### Additional notes
* [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)
publish-maven:
runs-on: ubuntu-latest
needs: [prepare-release]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-from-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
env:
UPDATE_BRANCH: update-from-template
UPDATE_BRANCH_MERGED: update-from-template-merged
REMOTE_URL: https://github.com/xdev-software/standard-maven-template.git
REMOTE_URL: https://github.com/xdev-software/vaadin-addon-template.git
REMOTE_BRANCH: master

permissions:
Expand Down
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,29 @@ hs_err_pid*
/*/.project
/*/RemoteSystemsTempFiles/


#vaadin/node webpack/frontend stuff
# Ignore Node
node/

# The following files are generated/updated by vaadin-maven-plugin
node_modules/

# Vaadin
package.json
package-lock.json
webpack.generated.js
webpack.config.js
tsconfig.json
types.d.ts
vite.config.ts
vite.generated.ts
/*/src/main/frontend/generated/
/*/src/main/frontend/index.html
/*/src/main/dev-bundle/
/*/src/main/bundles/
*.lock

#custom
.flattened-pom.xml
.tern-project
Expand Down
4 changes: 2 additions & 2 deletions .run/Run Demo.run.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="software.xdev.Application" />
<option name="MAIN_CLASS_NAME" value="software.xdev.vaadin.Application" />
<module name="template-placeholder-demo" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="software.xdev.*" />
<option name="PATTERN" value="software.xdev.vaadin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
Expand Down
16 changes: 15 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,20 @@ You should have the following things installed:
* Import the project
* Ensure that everything is encoded in ``UTF-8``
* Ensure that the JDK/Java-Version is correct

* To enable AUTOMATIC reloading/restarting while developing and running the app do this (further information in "
SpringBoot-Devtools" section below; [Source](https://stackoverflow.com/q/33349456)):
* ``Settings > Build, Execution, Deployment > Compiler``:<br/>
Enable [``Build project automatically``](https://www.jetbrains.com/help/idea/compiling-applications.html#auto-build)
* ``Settings > Advanced Settings``:<br/>
Enable [``Allow auto-make to start even if developed application is currently running``](https://www.jetbrains.com/help/idea/advanced-settings.html#advanced_compiler)
* To launch the Demo execute the predefined (launch) configuration ``Run Demo``

#### [SpringBoot-Developer-Tools](https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.devtools)
... should automatically be enabled.<br/>
If you are changing a file and build the project, parts of the app get restarted.<br/>
Bigger changes may require a complete restart.
* [Vaadin automatically reloads the UI on each restart](https://vaadin.com/docs/latest/configuration/live-reload/spring-boot).<br/>
You can control this behavior with the ``vaadin.devmode.liveReload.enabled`` property (default: ``true``).

## 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)

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

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

### Release failures

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0?logo=vaadin)](https://vaadin.com/directory/component/template-placeholder)
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder)
[![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)
[![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)
![Vaadin 24+](https://img.shields.io/badge/Vaadin%20Platform/Flow-24+-00b4f0)

# template-placeholder
A Vaadin Template Repo

![demo](assets/demo.png)


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

## Run the Demo
* Checkout the repo
* Run ``mvn install && mvn -f template-placeholder-demo spring-boot:run``
* Open http://localhost:8080

<details>
<summary>Show example</summary>

![demo](assets/demo.avif)
</details>

## Support
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).

Expand Down
Binary file added assets/demo.avif
Binary file not shown.
Binary file added assets/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
152 changes: 123 additions & 29 deletions template-placeholder-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,91 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<mainClass>software.xdev.Application</mainClass>
<mainClass>software.xdev.vaadin.Application</mainClass>

<!-- Dependency-Versions -->
<vaadin.version>24.4.11</vaadin.version>

<org.springframework.boot.version>3.3.3</org.springframework.boot.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<type>pom</type>
<scope>import</scope>
<version>${vaadin.version}</version>
</dependency>

<!-- Spring Boot -->
<!-- This bom provides versions for ~500 dependencies -->
<!-- Nearly at the end so that it doesn't accidentally overwrite other versions -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${org.springframework.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
</dependency>
<dependency>
<groupId>software.xdev</groupId>
<artifactId>template-placeholder</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Spring -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
</dependency>
<!-- Temporarily excluded by Vaadin due to "security vulnerability" -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>

<build>
<finalName>${project.artifactId}</finalName>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${org.springframework.boot.version}</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-frontend</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -52,34 +122,58 @@
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.1</version>
<configuration>
<archive>
<manifest>
<mainClass>${mainClass}</mainClass>
</manifest>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>production</id>
<dependencies>
<!-- Exclude development dependencies from production -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-dev</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-frontend</goal>
<goal>build-frontend</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>${mainClass}</mainClass>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package software.xdev.vaadin;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

import com.vaadin.flow.component.page.AppShellConfigurator;
import com.vaadin.flow.component.page.Push;
import com.vaadin.flow.spring.annotation.EnableVaadin;


@SpringBootApplication
@EnableVaadin
@Push
public class Application extends SpringBootServletInitializer implements AppShellConfigurator
{
public static void main(final String[] args)
{
SpringApplication.run(Application.class, args);
}
}

8 changes: 8 additions & 0 deletions template-placeholder-demo/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
vaadin:
allowed-packages: software/xdev,com/vaadin/flow

spring:
devtools:
restart:
poll-interval: 2s
quiet-period: 1s
Loading

0 comments on commit 2f10b25

Please sign in to comment.