Hello Apache Wicket和/或Maven Gurus,
我从这个链接尝试使用Springboot的Apache Wicket示例: https://github.com/MarcGiffing/wicket-spring-boot-examples/tree/master/simple
所以我在pom.xml中做的是:
...
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.giffing.wicket.spring.boot.starter</groupId>
<artifactId>wicket-spring-boot-starter-parent</artifactId>
<!-- <version>1.0.12</version> -->
</parent>
<groupId>com.giffing</groupId>
<artifactId>simple</artifactId>
<version>0.0.1</version>
<name>simple</name>
<properties>
<wicket.version>7.10.0</wicket.version>
</properties>
...
它会在HomePage.java中进行导入: import com.giffing.wicket.spring.boot.context.scan.WicketHomePage;
不明。
特定错误是:
描述资源路径位置类型
导入com.giffing.wicket.spring.boot.context无法解析HomePage.java / simple / src / main / java / com / giffing / examples / wicket / spring / boot / simple line 8 Java问题 < / p>
这里非常感谢您的专业知识。
谢谢,
阿坦尼斯
答案 0 :(得分:0)
你需要使用wicket-spring-boot-starter-parent:1.0.10。这是Wicket 7.x的最新版本:http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.giffing.wicket.spring.boot.starter%22%20AND%20a%3A%22wicket-spring-boot-starter-parent%22。 2.x代表Wicket 8.x。
您可以在项目中使用mvn dependency:tree
来查看Wicket,Spring Boot,Spring的哪些版本已实际解析。
如果这没有用,那么请提供更多关于错误的pom.xml以及更多信息。
答案 1 :(得分:0)
显然,我在这里使用的带有spring boot示例的apache-wicket可能存在一些问题。有关更多信息,请访问以下链接: https://github.com/MarcGiffing/wicket-spring-boot-examples/issues/2
但是这个pom.xml适用于我的简单apache-wicket和springboot集成项目。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
</parent>
<groupId>com.artanis</groupId>
<artifactId>WicketSpringboot</artifactId>
<version>0.0.1</version>
<name>WicketSpringboot</name>
<description></description>
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- maven generated -->
<maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
<maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.20.1</maven-surefire-plugin.version>
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
<maven-install-plugin.version>2.5.2</maven-install-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<!-- Wicket Springboot -->
<wicket-spring-boot-starter.version>2.1.0</wicket-spring-boot-starter.version>
<!-- Wicket -->
<wicket.version>8.0.0-M9</wicket.version>
</properties>
<dependencies>
<!-- Springboot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Wicket Springboot -->
<dependency>
<groupId>com.giffing.wicket.spring.boot.starter</groupId>
<artifactId>wicket-spring-boot-context</artifactId>
<version>${wicket-spring-boot-starter.version}</version>
</dependency>
<dependency>
<groupId>com.giffing.wicket.spring.boot.starter</groupId>
<artifactId>wicket-spring-boot-starter</artifactId>
<version>${wicket-spring-boot-starter.version}</version>
</dependency>
<!-- Wicket -->
<dependency>
<groupId>org.wicketstuff</groupId>
<artifactId>wicketstuff-annotation</artifactId>
<version>${wicket.version}</version>
</dependency>
<!-- slf4j-log4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<!-- <version>4.11</version> -->
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<!-- <resource>
<directory>src/main/resources/pages</directory>
</resource> -->
<resource>
<directory>src/main/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<!-- maven generated -->
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>${maven-install-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
谢谢,
阿坦尼斯