You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Luis Eric López Fernández <lu...@gmail.com> on 2012/06/02 00:18:32 UTC

Trouble downloading repositories

Hello,

I am just learning maven and I am having trouble with some repositories.

I attach my POM and here is the error message I am getting:

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[INFO] Compiling 2 source files to C:\Users\x0161479\Desktop\Eric's
Docs\Training\JEE 6\05292012\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[3,0] package javax.persistence does not
exist
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[5,1] cannot find symbol
symbol: class Entity
@Entity
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[6,1] cannot find symbol
symbol: class NamedQuery
@NamedQuery(name = "findAllBooks", query = "SELECT b FROM Book b")
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Main.java:[3,0] package javax.persistence does not
exist
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[9,5] cannot find symbol
symbol  : class Id
location: class com.apress.javaee6.chapter02.Book
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[9,9] cannot find symbol
symbol  : class GeneratedValue
location: class com.apress.javaee6.chapter02.Book
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[11,5] cannot find symbol
symbol  : class Column
location: class com.apress.javaee6.chapter02.Book
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[14,5] cannot find symbol
symbol  : class Column
location: class com.apress.javaee6.chapter02.Book
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Main.java:[19,2] cannot find symbol
symbol  : class EntityManagerFactory
location: class com.apress.javaee6.chapter02.Main
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Main.java:[20,5] cannot find symbol
symbol  : variable Persistence
location: class com.apress.javaee6.chapter02.Main
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Main.java:[21,2] cannot find symbol
symbol  : class EntityManager
location: class com.apress.javaee6.chapter02.Main
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Main.java:[24,2] cannot find symbol
symbol  : class EntityTransaction
location: class com.apress.javaee6.chapter02.Main
[INFO] 12 errors
[INFO] -------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 40.096s
[INFO] Finished at: Fri Jun 01 16:41:17 CDT 2012
[INFO] Final Memory: 6M/15M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(default-compile) on project chapter02: Compilation failure: Compilation
failure:
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[3,0] package javax.persistence does not
exist
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[5,1] cannot find symbol
[ERROR] symbol: class Entity
[ERROR] @Entity
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[6,1] cannot find symbol
[ERROR] symbol: class NamedQuery
[ERROR] @NamedQuery(name = "findAllBooks", query = "SELECT b FROM Book b")
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Main.java:[3,0] package javax.persistence does not
exist
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[9,5] cannot find symbol
[ERROR] symbol  : class Id
[ERROR] location: class com.apress.javaee6.chapter02.Book
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[9,9] cannot find symbol
[ERROR] symbol  : class GeneratedValue
[ERROR] location: class com.apress.javaee6.chapter02.Book
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[11,5] cannot find symbol
[ERROR] symbol  : class Column
[ERROR] location: class com.apress.javaee6.chapter02.Book
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Book.java:[14,5] cannot find symbol
[ERROR] symbol  : class Column
[ERROR] location: class com.apress.javaee6.chapter02.Book
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Main.java:[19,2] cannot find symbol
[ERROR] symbol  : class EntityManagerFactory
[ERROR] location: class com.apress.javaee6.chapter02.Main
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Main.java:[20,5] cannot find symbol
[ERROR] symbol  : variable Persistence
[ERROR] location: class com.apress.javaee6.chapter02.Main
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Main.java:[21,2] cannot find symbol
[ERROR] symbol  : class EntityManager
[ERROR] location: class com.apress.javaee6.chapter02.Main
[ERROR] \Users\x0161479\Desktop\Eric's Docs\Training\JEE
6\05292012\src\main\java\Main.java:[24,2] cannot find symbol
[ERROR] symbol  : class EntityTransaction
[ERROR] location: class com.apress.javaee6.chapter02.Main
[ERROR] -> [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/MojoFailureException

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Any help will be greatly appreciated!

Thanks in advance!
Eric

Re: Trouble downloading repositories

Posted by Wayne Fay <wa...@gmail.com>.
> I am just learning maven and I am having trouble with some repositories.

No, this is not a problem with repositories.

> 6\05292012\src\main\java\Book.java:[3,0] package javax.persistence does not
> exist
..
> 6\05292012\src\main\java\Book.java:[5,1] cannot find symbol
> symbol: class Entity
...
> 6\05292012\src\main\java\Book.java:[6,1] cannot find symbol
> symbol: class NamedQuery

You are missing one or more dependencies which means the Java compiler
cannot find classes which are imported in your code.

Looking at your pom file, it appears that you don't understand the
difference between simply having <dependencies> in your pom vs having
them listed in a <dependencyManagement> section.

Review this concept in various sources of documentation online such as:
http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-project-dependencies.html

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org