eliassal
|
Posted: December 02, 2010 19:40 by eliassal
|
|
I am trying to compile the code for Ch 2, using mvn compile, get a huge error Visited the errata page, understood that a new version of code is available, clicking on download we land on a page where chapters directory structure is shown but there is no link to download the whole code or a chapter by chapter basis Here is the full error message
|
Chapter 2 code doesnt compile
by: matthewcornell
Alexis Moussine-Pouchkine
|
Posted: December 02, 2010 21:15 by Alexis Moussine-Pouchkine
|
| Which version of Maven? I think Antonio tested this with Maven 2.x only (not 3.0) |
eliassal
|
Posted: December 02, 2010 20:34 by eliassal
|
|
I forgot to mention that I opened the project in Netbeans, I get red circles on the project itself as well as book and main files. A red circle beside the line import javax.persistence.*; and, a hint appears indicating that package javax.persistence does not exist and it does not suggest anything I tried adding several jars (Toplink Essentials , JPA.....) it didnt help Near @Entity, I have a yellow light with red circle, hoverig it, it suggests adding - import for java.swing.text..... - import org.w3c.dom.... |
eliassal
|
Posted: December 03, 2010 09:43 by eliassal
|
|
Yes, I have "apache-maven-3.0". As I am very new to this platform (java maven....), does this mean that the code can not be adapted to be executed in maven 3. When I read in cha1 "I.ve decide to use Maven", I downloaded the ost recent version then I noticed that he talked about version 2.2.1. I come from other platforms, always there is a backward compatibility which I thought it would be the same thing for the java platform. Can you please confirm if I can not run the code with maven 3 in order to remove it and setup the 2.2.1 version. Regards |
eliassal
|
Posted: December 03, 2010 20:50 by eliassal
|
Ok, I downloaded maven 2.2.1, created a hard ink in Chapter02 to this version of mvn, ran./mvn2 compile as well as ./mvn2 -e compile In the command line I am getting :
In Netbeans, I configured Maven to point to 2.2.1, ran build, I got the following :
|
matthewcornell
|
Posted: January 27, 2012 19:52 by matthewcornell
|
|
Even with this, I cannot compile (BUILD FAILURE). Using Apache Maven 3.0.3 and the latest svn of your code. mvn compile generates the following failed output. Please advise. ==== Macintosh:chapter02 matt$ cd /Users/matt/IdeaProjects/beginningee6\~src/book/tags/1.0.1/chapter02 ; mvn compile [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.apress.javaee6:chapter02:jar:1.0 [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ com.apress.javaee6:chapters:1.0, /Users/matt/IdeaProjects/beginningee6~src/book/tags/1.0.1/pom.xml, line 1, column 3930 [WARNING] 'repositories.repository.layout' for maven-repository.dev.java.net uses the unsupported value 'legacy', artifact resolution might fail. @ com.apress.javaee6:chapters:1.0, /Users/matt/IdeaProjects/beginningee6~src/book/tags/1.0.1/pom.xml, line 1, column 2290 [WARNING] 'repositories.repository.layout' for Apache Repo uses the unsupported value 'legacy', artifact resolution might fail. @ com.apress.javaee6:chapters:1.0, /Users/matt/IdeaProjects/beginningee6~src/book/tags/1.0.1/pom.xml, line 1, column 3606 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Chapter 02 - JPA 1.0 [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.737s [INFO] Finished at: Fri Jan 27 14:50:49 EST 2012 [INFO] Final Memory: 2M/81M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project chapter02: Could not resolve dependencies for project com.apress.javaee6:chapter02:jar:1.0: Failed to collect dependencies for [org.eclipse.persistence:javax.persistence:jar:2.0.0-M9 (provided), org.eclipse.persistence:eclipselink:jar:2.0.0-M9 (provided), org.apache.derby:derbyclient:jar:10.5.3.0 (compile), org.apache.derby:derby:jar:10.5.3.0 (test), junit:junit:jar:4.7 (test)]: Failed to read artifact descriptor for org.eclipse.persistence:javax.persistence:jar:2.0.0-M9: Could not transfer artifact org.eclipse.persistence:javax.persistence om:2.0.0-M9 from/to maven-repository.dev.java.net (http://download.java.net/maven/1): No connector available to access repository maven-repository.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory -> [Help 1][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/DependencyResolutionException ==== |
by: matthewcornell


om:2.3' in repository maven2-repository.dev.java.net (http://download.java.net/maven/2/)





