MarcGiffing / wicket-spring-boot-examples

Apache License 2.0
14 stars 10 forks source link

Parent Version will get overriden by artifact version #2

Open artaniszeratul opened 6 years ago

artaniszeratul commented 6 years ago

Hello @MarcGiffing,

I was trying your example here. This one in particular: https://github.com/MarcGiffing/wicket-spring-boot-examples/tree/master/simple

So what I did in the pom.xml is this:

...
  <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>

...

What happens is that it will make the import in HomePage.java: import com.giffing.wicket.spring.boot.context.scan.WicketHomePage;

to be unknown. The particular error is: Description Resource Path Location Type The import com.giffing.wicket.spring.boot.context cannot be resolved HomePage.java /simple/src/main/java/com/giffing/examples/wicket/spring/boot/simple line 8 Java Problem

Your expertise will be much appreciated here.

Thanks, Artanis

MarcGiffing commented 6 years ago

Hey Artanis,

why is the version in the parent pom commented out? Can you also show your dependencies?

Greets

artaniszeratul commented 6 years ago

Hello @MarcGiffing ,

My apologies, that shouldn't have been commented but with this instead:

  <parent>
        <groupId>com.giffing.wicket.spring.boot.starter</groupId>
        <artifactId>wicket-spring-boot-starter-parent</artifactId>
        <version>1.0.12</version>
    </parent>

I have attached the pom.xml here for more details: pom.xml.zip

And here is the dependency tree log as well: dependencyTree.log.zip

Thanks, Artanis

thlaegler commented 6 years ago

Moin Moin @MarcGiffing , it's because you use for the versions in the parent project "${project.version}" This value will be overridden as soon as you created a custom project with a different version and inherit from your parent module. When you use dependencyManagement the version should be "fixed" in parent-module like e.g. in the module "spring-boot-dependencies"

MarcGiffing commented 6 years ago

@thlaegler your right, thanks! I'll fix that. @artaniszeratul maybe you shouldn't use the starter as a parent pom cause you can't update the Spring Boot parent pom independently which the starter uses itself as a parent.

I'll take a look the next days, sorry.

artaniszeratul commented 6 years ago

@MarcGiffing ... ok noted. But are you trying to suggest that I should follow the pom in this release: https://github.com/MarcGiffing/wicket-spring-boot/releases/tag/wicket-spring-boot-starter-parent-1.0.12

Thanks, Artanis

MarcGiffing commented 6 years ago

I suggest to use Spring Boots parent pom.

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.11.RELEASE</version>
        <relativePath />
    </parent>

If not your sticked to the version which I have defined in the latest release. But its better you can update Spring Boot independently from the Wicket Starter pom.

artaniszeratul commented 6 years ago

Hello @MarcGiffing,

Yes, I have used springboot parent. And used your wicket-spring-boot-starter-parent's pom as a template for my pom projects. It worked!

I even used the latest versions wicket-starter version: 2.10 wicket-version: 8.0.0-M9. And it worked as well!

Here is the copy of the pom.xml I have used:

pom.xml.zip

Heaps of thanks @MarcGiffing and @thlaegler! You are the keyboard superheroes here!

Kind Regards, Artanis