【问题标题】:Vaadin Maven Spring Boot theme compileVaadin Maven Spring Boot 主题编译
【发布时间】:2016-07-21 08:28:48
【问题描述】:

在我的项目 Vaadin Maven Spring Boot 中,我无法编译主题,但另一篇文章中的同一个项目可以正常工作,并且主题可以轻松编译。请问有什么想法吗?

这是我的 pom.xml:

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

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.version>1.8</java.version>
	</properties>
	<repositories>
		<repository>
			<id>vaadin-addons</id>
			<url>http://maven.vaadin.com/vaadin-addons</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
		 <repository>
       <id>AsposeJavaAPI</id>
       <name>Aspose Java API</name>
       <url>http://maven.aspose.com/artifactory/simple/ext-release-local/</url>
   </repository>
	</repositories>
	<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-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-spring-boot-starter</artifactId>
			<version>1.0.0</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-velocity</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-tomcat</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>core-framework</groupId>
			<artifactId>core-framework</artifactId>
			<version>0.0.1-SNAPSHOT</version>
			<type>ejb</type>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>18.0</version>
		</dependency>
		<dependency>
			<groupId>org.vaadin.addon</groupId>
			<artifactId>confirmdialog</artifactId>
			<version>2.1.1</version>
		</dependency>
		<dependency>
			<groupId>org.flywaydb</groupId>
			<artifactId>flyway-core</artifactId>
		</dependency>

		<dependency>
			<groupId>com.aspose</groupId>
			<artifactId>aspose-words</artifactId>
			<classifier>jdk16</classifier>
			 <version>16.4.0</version>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-themes</artifactId>
			<version>7.4.4</version>
		</dependency>
	</dependencies>

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

		</dependencies>
	</dependencyManagement>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>

		</plugins>

	</build>

这是错误:enter image description here

【问题讨论】:

  • 请花时间阅读this,以提高您的问题质量。添加代码、pom.xml、构建日志、错误日志。
  • 好的,Steffen 先生,我正在更改我的帖子
  • 您是否为您的项目定义了主题?此外,从屏幕截图来看,您似乎正在使用 IDE 插件、eclipse、intellij 等进行编译。如果您尝试通过 maven 进行编译,是否会遇到同样的错误?
  • 是的,我的项目中有一个主题。如何用 maven 编译它??
  • Vaadin documentation 是查找信息的好地方

标签: java maven spring-boot vaadin


【解决方案1】:

如果我对问题的理解正确,您有一个带有 Vaadin 的 Spring Boot 项目,并且您想编译一个自定义主题?如果是这样,请看看我的example project on GithHub。归根结底,您需要告诉 Vaadin 插件在 resources 下查找主题,而不是在 webapp 下查找主题。

所以你的 pom.xml 中有 Vaadin 插件配置

    <build>
    <plugins>
        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>

确保你有配置

            <configuration>
            ...
            <warSourceDirectory>${basedir}/src/main/resources
            ...
            </configuration>

还有目标

            <executions>
                <execution>
                    <goals>
                        <goal>resources</goal>
                        <goal>update-theme</goal>
                        <goal>update-widgetset</goal>
                        <goal>compile-theme</goal>
                        <goal>compile</goal>
                    </goals>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-14
    • 2018-10-03
    • 2019-07-22
    • 2018-06-24
    • 1970-01-01
    • 2021-05-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多