Vaadin Maven Spring Boot主题编译

时间:2016-07-21 08:28:48

标签: java maven spring-boot vaadin

在我的项目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

1 个答案:

答案 0 :(得分:2)

如果我正确理解了问题,你有一个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>