How to build
Apologies for what is almost certainly a n00b Maven question, but how do you build this thing. My inclination was to run "mvn compile" in the java-root directory:
$ mvn compile
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.tensin.sonos:sonos-java:1.0.0-SNAPSHOT (/Volumes/Data/github/sonos-java/sonos-java/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact org.tensin.sonos:sonos-root:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
As a maven project with sub-modules, you have (usually) to work in the sonos-root module. The sonos-java module as a "parent pom" (top of the pom.xml) in order to inherit a few maven properties, dependencies, versions, and so on. So if you run for example "mvn compile" in sonos-root to build the classes, or "mvn install" to build the jar, it should be a bit better. I just think that a required library won't be found (see another issue), as it hasn't been published in the maven repositories by the team working on that library. So you have to download it on the cling website and to install it in your local repository (.m2) (where all downloaded jars are stored) with the command that will be dumped by maven when it says that the library is missing (ugly command with a lot of parameters).
I hate to continue to be clueless, but I had tried it in sonos-root too, didn't seem to be much different:
$ mvn compile
[INFO] Scanning for projects...
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]
[ERROR] The project org.tensin.sonos:sonos-java:1.0.0-SNAPSHOT (/Volumes/Data/github/sonos-java/sonos-java/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact org.tensin.sonos:sonos-root:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 10 -> [Help 2]
[ERROR]
[ERROR] The project org.tensin.sonos:sonos-web:1.0.0-SNAPSHOT (/Volumes/Data/github/sonos-java/sonos-web/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find org.tensin.sonos:sonos-root:pom:1.0.0-SNAPSHOT in http://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of vaadin-addons has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 13, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Hello, I don't know how to help you. What is your maven version ? (mvn --version) I'm using Maven 2.2.1, but i've just checked with Maven 3, it works the same. In order to work, your directory layout has to be the same than the one on github (all modules on the same level) :
README.md sonos-java sonos.jpg sonos-root sonos-web
then : cd sonos-root mvn validate mvn install
and so on
Serge.
On Thu, Oct 4, 2012 at 3:12 AM, Norman Walsh [email protected]:
I hate to continue to be clueless, but I had tried it in sonos-root too, didn't seem to be much different:
$ mvn compile [INFO] Scanning for projects... [ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]
[ERROR] The project org.tensin.sonos:sonos-java:1.0.0-SNAPSHOT (/Volumes/Data/github/sonos-java/sonos-java/pom.xml) has 1 error [ERROR] Non-resolvable parent POM: Could not find artifact org.tensin.sonos:sonos-root:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 10 -> [Help 2] [ERROR]
[ERROR] The project org.tensin.sonos:sonos-web:1.0.0-SNAPSHOT (/Volumes/Data/github/sonos-java/sonos-web/pom.xml) has 1 error [ERROR] Non-resolvable parent POM: Failure to find org.tensin.sonos:sonos-root:pom:1.0.0-SNAPSHOT in http://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of vaadin-addons has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 13, column 10 -> [Help 2]
[ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
— Reply to this email directly or view it on GitHubhttps://github.com/SR-G/sonos-java/issues/3#issuecomment-9127772.
Well, maven 3.0.4 gives me exactly the same errors on the Mac and a clean Linux VM.
My loathing for Maven knows almost now end. I'll just turn it into an IntelliJ project and work out the dependencies myself :-)
Thanks for trying to help.
I'm not a big fan of Maven in the end (gradle seems way better) but i'm so used to work with it that i put back on every project, but i've never seen your behavior. One last thing you can try if you'd like to :
- in sonos-root/pom.xml, comment the "modules" section
- make a "mvn install" in the sonos-root module
- then try a "mvn compile" in the sonos-java module
Regards
Serge.
On Thu, Oct 4, 2012 at 3:03 PM, Norman Walsh [email protected]:
Well, maven 3.0.4 gives me exactly the same errors on the Mac and a clean Linux VM.
My loathing for Maven knows almost now end. I'll just turn it into an IntelliJ project and work out the dependencies myself :-)
Thanks for trying to help.
— Reply to this email directly or view it on GitHubhttps://github.com/SR-G/sonos-java/issues/3#issuecomment-9140394.
That certainly got me further. The install in sonos-root worked, and compile in sonos-java at least tried to compile some stuff:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project sonos-java: Compilation failure: Compilation failure: [ERROR] /Volumes/Data/github/sonos-java/sonos-java/src/main/java/org/tensin/sonos/guice/GuiceSonosInjector.java:[3,24] package com.google.inject does not exist [ERROR] /Volumes/Data/github/sonos-java/sonos-java/src/main/java/org/tensin/sonos/guice/GuiceSonosInjector.java:[15,18] cannot find symbol [ERROR] symbol : class Injector [ERROR] location: class org.tensin.sonos.guice.GuiceSonosInjector
I wonder if you wouln't have a repository / settings.xml issue ... does a simple maven project works ? (a simple pom.xml with only one dependency)
Otherwise, there are plugins for maven to convert dependencies from maven to eclipse or intellij idea, but i'm quite unsure that in your situation it will work (as it rely on the main pom.xml and the ones from the submodules) (check "mvn eclipse:eclipse" or "mvn idea:idea")
http://maven.apache.org/plugins/maven-idea-plugin/
Serge.
On Thu, Oct 4, 2012 at 5:51 PM, Norman Walsh [email protected]:
That certainly got me further. The install in sonos-root worked, and compile in sonos-java at least tried to compile some stuff:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project sonos-java: Compilation failure: Compilation failure: [ERROR] /Volumes/Data/github/sonos-java/sonos-java/src/main/java/org/tensin/sonos/guice/GuiceSonosInjector.java:[3,24] package com.google.inject does not exist [ERROR] /Volumes/Data/github/sonos-java/sonos-java/src/main/java/org/tensin/sonos/guice/GuiceSonosInjector.java:[15,18] cannot find symbol [ERROR] symbol : class Injector [ERROR] location: class org.tensin.sonos.guice.GuiceSonosInjector
— Reply to this email directly or view it on GitHubhttps://github.com/SR-G/sonos-java/issues/3#issuecomment-9146266.
I had the same problem as ndw (guice was missing from the dependencies). I downloaded it manually and put in on CP, which worked. But I'd assume that a freshly checked out maven project would build out of the box?
Right ! A while ago, i was using guice (which is a great dependency injection framework). For various reasons, i removed it (and thus removed the guice dependency in the pom.xml). Sadly, i hadn't commited to github the removal of a few guice classes. That's why the project on github wasn't compiling. I've commited the removal of those classes, everything should be up to date now.
I did a clean clone of the repository, but the guice dependent classes were still there. Also see https://github.com/SR-G/sonos-java/tree/master/sonos-java/src/main/java/org/tensin/sonos/guice
Indeed, something went wront on my git add -u / git push. Files removed. Thanks for pointing it out.