Reputation: 1117
Blockquote
J have a Eclipse workspace with a maven parent project (parent) and child > >projects (Domain,Web,Win) The parent pom contains the wicket-spring-boot-starter-parent
<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>
<groupId>org.SteinKo.ATM</groupId>
<artifactId>Parent</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>
<name>Parent</name>
<url>http://maven.apache.org</url>
<modules>
<module>Domain</module>
<module>Web</module>
<module>Win</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<scm>
<connection>scm:[email protected]:steinKo/ATM.git</connection>
<url>https://github.com/steinKo/ATM.git</url>
</scm>
<parent>
<!-- https://mvnrepository.com/artifact/com.giffing.wicket.spring.boot.starter/wicket-spring-boot-starter-parent -->
<groupId>com.giffing.wicket.spring.boot.starter</groupId>
<artifactId></artifactId>
<version>2.0.3</version>
</parent>
The web projects contains a Wicket pages
package steinKo.ATM;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import steinKo.ATM.presentaion.web.HomePage;
@SpringBootApplication
public class Web {
public static void main(String[] args) throws Exception {
new SpringApplicationBuilder().sources(Web.class).run(args);
}
public Class<HomePage> getHomePage() {
return HomePage.class;
}
}
package steinKo.ATM.presentaion.web;
import com.giffing.wicket.spring.boot.context.scan.WicketHomePage;
import org.apache.wicket.markup.html.WebPage;
import steinKo.ATM.domain.ATM;
import steinKo.ATM.domain.Bank;
@WicketHomePage
public class HomePage extends WebPage {
/**
*
*/
private static final long serialVersionUID = 1L;
private ATM atm;
private Bank bank;
public HomePage() {
bank = new Bank();
atm = new ATM(bank);
add(new MenuPanel("menuPanel"));
add(new ContentPanel("contentPanel", atm));
}
}
The pom.xml for the web contain dependency to wicket-spring-boot-starter
http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0
<artifactId>Web</artifactId>
<parent>
<groupId>org.SteinKo.ATM</groupId>
<artifactId>Parent</artifactId>
<version>0.0.1</version>
<relativePath />
</parent>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.wicket/wicket-core -->
<dependency>
<groupId>com.giffing.wicket.spring.boot.starter</groupId>
<artifactId>wicket-spring-boot-starter</artifactId>
</dependency>
When I execute maven test on parent project I get the message
[INFO] Scanning for projects...
[ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for com.giffing.wicket.spring.boot.starter:wicket-spring-boot-starter:jar is missing. @ org.SteinKo.ATM:Web:[unknown-version], /Users/stein/Development/ATM/Parent/Web/pom.xml, line 20, column 16
[ERROR] 'dependencies.dependency.version' for org.seleniumhq.selenium:selenium-java:jar is missing. @ org.SteinKo.ATM:Web:[unknown-version], /Users/stein/Development/ATM/Parent/Web/pom.xml, line 28, column 13 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR] The project org.SteinKo.ATM:Web:0.0.1 (/Users/stein/Development/ATM/Parent/Web/pom.xml) has 2 errors
[ERROR] 'dependencies.dependency.version' for com.giffing.wicket.spring.boot.starter:wicket-spring-boot-starter:jar is missing. @ org.SteinKo.ATM:Web:[unknown-version], /Users/stein/Development/ATM/Parent/Web/pom.xml, line 20, column 16
[ERROR] 'dependencies.dependency.version' for org.seleniumhq.selenium:selenium-java:jar is missing. @ org.SteinKo.ATM:Web:[unknown-version], /Users/stein/Development/ATM/Parent/Web/pom.xml, line 28, column 13
[ERROR]
and the import com.giffing.wicket.spring.boot.context.scan.WicketHomePage; and @WicketHomePage is marked red in the has a message "Can not be resolved"
Why?
Upvotes: 0
Views: 368
Reputation: 4509
It look like maven build issue for me dependencies.dependency.version
not properly loading the dependency of com.giffing.wicket.spring.boot.starter
from parent . Please build using mvn clean install
from parent
to all the project and fix . Its nothing to do with code .
And more over i'm not sure whether you shared your full pom
add this Your pom not correct change this
<groupId>com.giffing.wicket.spring.boot.starter</groupId>
<artifactId></artifactId>
<version>2.0.3</version>
to
<dependency>
<groupId>com.giffing.wicket.spring.boot.starter</groupId>
<artifactId>wicket-spring-boot-starter</artifactId>
<version>2.0.3</version>
</dependency>
Upvotes: 1