Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Extra parent level in ch-multi example code #25

Open
apjanke opened this issue May 26, 2015 · 6 comments
Open

Extra parent level in ch-multi example code #25

apjanke opened this issue May 26, 2015 · 6 comments

Comments

@apjanke
Copy link
Contributor

apjanke commented May 26, 2015

In the chapter on Multi-Module Projects, it describes a parent project in simple-parent, and two submodules underneath it. The example POMs in the chapter text itself reflect this structure. But in the examples/ch-multi code, there are three levels of modules: the simple-parent project itself is a submodule underneath the top ch-multi directory, which has its own POM.

This also has the effect of breaking the mvn jetty:run example for me if I'm following the examples in the book exactly. In the section "Building the Multimodule Project", it has you run mvn clean install from the simple-parent directory. But if I do this, the later mvn jetty:run call from within simple-webapp/ will fail with an error like this.

[ERROR] Failed to execute goal on project simple-webapp: Could not resolve dependencies for project org.sonatype.mavenbook.multi:simple-webapp:war:0.8-SNAPSHOT: Failed to collect dependencies at org.sonatype.mavenbook.multi:simple-weather:jar:0.8-SNAPSHOT: Failed to read artifact descriptor for org.sonatype.mavenbook.multi:simple-weather:jar:0.8-SNAPSHOT: Could not find artifact org.sonatype.mavenbook.multi:parent:pom:0.8-SNAPSHOT -> [Help 1]

I think this is because it's not finding that extra top-level artifact. If I move up to ch-multi and do mvn clean install from there, then the mvn jetty:run example works.

This seems a little confusing. Should the examples code be changed to match the two-level structure in the chapter text?

@unk1911
Copy link

unk1911 commented Jul 17, 2015

I agree I had the same issue-- thanks for pointing it out.

@mosabua
Copy link
Contributor

mosabua commented Jul 18, 2015

This is a requirement from the publishing point of view. I might be able to change that if I try to refactor the publishing process. Let me think about this for a bit.

@Zaijo
Copy link

Zaijo commented Nov 14, 2017

Anything new? At least this bug shows up when searching for "org.sonatype.mavenbook.multi:parent:pom:0.8-SNAPSHOT" when people encuounter this problem.

Workaround by @apjanke worked :) Thanks.

@fabeliflow
Copy link

@Zaijo I was able to run jetty but I know from Chapter 5 that the yahoo weather api changed. If you are using weather.yahooapis.com as your weather endpoint, it is retiring soon. Please update your apps to use weather via YQL https://query.yahooapis.com. So you will have to change two files to make it work: YahooRetriever (https://gist.github.com/fabeliflow/ef8e499a892d1b276e4d05f6b8bfe20b) and YahooParser (https://gist.github.com/fabeliflow/f5396e66ca40434e0ad566770b53c51c).

I hope this helps! The book is great (and free) but it needs some updates!

Fabio

@fabeliflow
Copy link

@apjanke And thanks for not letting me waste a day trying to figure that out! This proves that you really have to follow Maven's convention! Once you do, then it runs smooth!

@sophister
Copy link

same problem, half a day wasted :(
Thx @apjanke for saving my life

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants