Discussion:
Compile failure, package not found
Erwin Mueller
2011-04-05 17:09:43 UTC
Permalink
Hello,

I just created a new project and after finishing it in Eclipse I try
to compile it in maven, but I get compile error that the package is not found.
I'm pretty sure that everything is just normal, I have used maven for a lot of
projects already. I'm 100% sure the Jar is in the classpath of the compiler,
every other project I compile in maven with 'mvn clean compile' works.

Here I deleted the Jars in .m2/repository and as you can see maven
will download the Jars again. Other projects with the same Jar working 100%,
just not this project.

I attached the pom.xml from the parent and from the module. I just
copied everything from older projects, which I'm sure working. You can see I
have other Jars, like guice-assisted-inject or rssconjava-api with are
working. It's just the rssconjava-impl which is not working.

I have no idea what is going on here. Why is only package
com.globalscalingsoftware.rsscon.internal not found and every other package is
found. I am using commons-lang with is not found, too. package
com.google.common.base does not exist. But I'm using commons-lang in every
other project and it's working just fine.

Kind regards,
Erwin.

$ mvn clean compile
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] qhdriver-parent
[INFO] qhdriver-native
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building qhdriver-parent 0.0.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ qhdriver-parent
---
[INFO]
[INFO] --- gmaven-plugin:1.3:generateStubs (default) @ qhdriver-parent ---
[INFO] No sources found for Java stub generation
[INFO]
[INFO] --- gmaven-plugin:1.3:compile (default) @ qhdriver-parent ---
[INFO] No sources found to compile
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building qhdriver-native 0.0.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/internal/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/snapshots/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.pom
Downloaded: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.pom (525 B at 1.0 KB/sec)
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/internal/com/globalscalingsoftware/rsscon/rssconjava/1.2/rssconjava-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/snapshots/com/globalscalingsoftware/rsscon/rssconjava/1.2/rssconjava-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava/1.2/rssconjava-1.2.pom
Downloaded: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava/1.2/rssconjava-1.2.pom
(2 KB at 6.0 KB/sec)
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/internal/com/globalscalingsoftware/rsscon/rssconjava-
impl/1.2/rssconjava-impl-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/snapshots/com/globalscalingsoftware/rsscon/rssconjava-
impl/1.2/rssconjava-impl-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
impl/1.2/rssconjava-impl-1.2.pom
Downloaded: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
impl/1.2/rssconjava-impl-1.2.pom (889 B at 24.8 KB/sec)
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/internal/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.jar
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/snapshots/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.jar
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.jar
Downloaded: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.jar (4 KB at 9.7 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ qhdriver-native
---
[INFO] Deleting /read/projects/com.globalscalingsoftware/qhdriver/qhdriver-
parent/qhdriver-native/target
[INFO]
[INFO] --- gmaven-plugin:1.3:generateStubs (default) @ qhdriver-native ---
[INFO] No sources found for Java stub generation
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @
qhdriver-native ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ qhdriver-
native ---
[INFO] Compiling 11 source files to
/read/projects/com.globalscalingsoftware/qhdriver/qhdriver-parent/qhdriver-
native/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /read/projects/com.globalscalingsoftware/qhdriver/qhdriver-
parent/qhdriver-
native/src/main/java/com/globalscalingsoftware/qhdriver/internal/InternalModule.java:
[9,48] package com.globalscalingsoftware.rsscon.internal does not exist
[ERROR] /read/projects/com.globalscalingsoftware/qhdriver/qhdriver-
parent/qhdriver-
native/src/main/java/com/globalscalingsoftware/qhdriver/internal/InternalModule.java:
[16,30] cannot find symbol
symbol : class RssconDriverImpl
location: class com.globalscalingsoftware.qhdriver.internal.InternalModule
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] qhdriver-parent ................................... SUCCESS [1.344s]
[INFO] qhdriver-native ................................... FAILURE [6.614s]
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 8.130s
[INFO] Finished at: Tue Apr 05 18:59:17 CEST 2011
[INFO] Final Memory: 10M/129M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-
plugin:2.3.2:compile (default-compile) on project qhdriver-native: Compilation
failure: Compilation failure:
[ERROR] /read/projects/com.globalscalingsoftware/qhdriver/qhdriver-
parent/qhdriver-
native/src/main/java/com/globalscalingsoftware/qhdriver/internal/InternalModule.java:
[9,48] package com.globalscalingsoftware.rsscon.internal does not exist
[ERROR] /read/projects/com.globalscalingsoftware/qhdriver/qhdriver-
parent/qhdriver-
native/src/main/java/com/globalscalingsoftware/qhdriver/internal/InternalModule.java:
[16,30] cannot find symbol
[ERROR] symbol : class RssconDriverImpl
[ERROR] location: class
com.globalscalingsoftware.qhdriver.internal.InternalModule
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the
command
[ERROR] mvn <goals> -rf :qhdriver-native
--
Erwin Mueller, ***@deventm.org
http://www.global-scaling-institute.de/
http://www.deventm.org
Wayne Fay
2011-04-05 19:29:06 UTC
Permalink
Post by Erwin Mueller
[9,48] package com.globalscalingsoftware.rsscon.internal does not exist
...
Post by Erwin Mueller
[16,30] cannot find symbol
symbol : class RssconDriverImpl
location: class com.globalscalingsoftware.qhdriver.internal.InternalModule
You declared the dependency on impl as such:
<dependency>
<groupId>com.globalscalingsoftware.rsscon</groupId>
<artifactId>rssconjava-impl</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>

Thus, the impl is not coming in during the compile phase. It will only
be used during the test phase. If this is not correct, change the
<scope>.

Wayne
Erwin Mueller
2011-04-06 07:25:35 UTC
Permalink
Yes, so true. I realized that but I already send the email. I think I
was just too tired, I hacked the project together in one day.

But I was confused, because maven could not find the package
com.google.common.base from commons-lang either. So I thought, was is going on
that it can't find that package. After I made rssconjava-impl compile scope,
it compiles everything fine.

So why maven couldn't find commons-lang? The two packages were not
used in the same class (the com.globalscalingsoftware.rsscon.internal package
and the com.google.common.base package).
Post by Wayne Fay
Post by Erwin Mueller
[9,48] package com.globalscalingsoftware.rsscon.internal does not exist
...
Post by Erwin Mueller
[16,30] cannot find symbol
symbol : class RssconDriverImpl
location: class
com.globalscalingsoftware.qhdriver.internal.InternalModule
<dependency>
<groupId>com.globalscalingsoftware.rsscon</groupId>
<artifactId>rssconjava-impl</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
Thus, the impl is not coming in during the compile phase. It will only
be used during the test phase. If this is not correct, change the
<scope>.
Wayne
---------------------------------------------------------------------
--
Erwin Mueller, ***@deventm.org
http://www.global-scaling-institute.de/
http://www.deventm.org
Wayne Fay
2011-04-06 17:18:51 UTC
Permalink
       So why maven couldn't find commons-lang? The two packages were not
used in the same class (the com.globalscalingsoftware.rsscon.internal package
and the com.google.common.base package).
Perhaps something related to transitive dependencies.

Wayne
Justin Edelson
2011-04-06 17:37:13 UTC
Permalink
       Yes, so true. I realized that but I already send the email. I think I
was just too tired, I hacked the project together in one day.
       But I was confused, because maven could not find the package
com.google.common.base from commons-lang either.
Perhaps this is because commons-lang contains classes in the
org.apache.commons.lang package structure, not anything starting with
com.google.common.
Erwin Mueller
2011-04-07 21:07:14 UTC
Permalink
Post by Justin Edelson
Post by Erwin Mueller
Yes, so true. I realized that but I already send the email. I
think I was just too tired, I hacked the project together in one day.
But I was confused, because maven could not find the package
com.google.common.base from commons-lang either.
Perhaps this is because commons-lang contains classes in the
org.apache.commons.lang package structure, not anything starting with
com.google.common.
Thank you, yes you are correct. The class Preconditions is in the
Guava Jar and I got it from a different Jar which was in the scope test. I
could used it in Eclipse without problems, but than maven complained because
it was in the test scope. The MEclipse plugin should show warnings or errors
if someone try to use a class from the test scope in src/main/java.
--
Erwin Mueller, ***@deventm.org
http://www.global-scaling-institute.de/
http://www.deventm.org
Martin Gainty
2011-04-05 22:01:36 UTC
Permalink
Herr Mueller-

can you verify the package of
/read/projects/com.globalscalingsoftware/qhdriver/qhdriver-parent/qhdriver-native/src/main/java
com/globalscalingsoftware/qhdriver/internal/InternalModule.java:
is package com.globalscalingsoftware.rsscon.internal;
head InternalModule.java 100
should show the package statement in InternalModule.java

?
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




From: ***@deventm.org
To: ***@maven.apache.org
Subject: Compile failure, package not found
Date: Tue, 5 Apr 2011 19:09:43 +0200

Hello,

I just created a new project and after finishing it in Eclipse I try
to compile it in maven, but I get compile error that the package is not found.
I'm pretty sure that everything is just normal, I have used maven for a lot of
projects already. I'm 100% sure the Jar is in the classpath of the compiler,
every other project I compile in maven with 'mvn clean compile' works.

Here I deleted the Jars in .m2/repository and as you can see maven
will download the Jars again. Other projects with the same Jar working 100%,
just not this project.

I attached the pom.xml from the parent and from the module. I just
copied everything from older projects, which I'm sure working. You can see I
have other Jars, like guice-assisted-inject or rssconjava-api with are
working. It's just the rssconjava-impl which is not working.

I have no idea what is going on here. Why is only package
com.globalscalingsoftware.rsscon.internal not found and every other package is
found. I am using commons-lang with is not found, too. package
com.google.common.base does not exist. But I'm using commons-lang in every
other project and it's working just fine.

Kind regards,
Erwin.

$ mvn clean compile
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] qhdriver-parent
[INFO] qhdriver-native
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building qhdriver-parent 0.0.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ qhdriver-parent
---
[INFO]
[INFO] --- gmaven-plugin:1.3:generateStubs (default) @ qhdriver-parent ---
[INFO] No sources found for Java stub generation
[INFO]
[INFO] --- gmaven-plugin:1.3:compile (default) @ qhdriver-parent ---
[INFO] No sources found to compile
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building qhdriver-native 0.0.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/internal/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/snapshots/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.pom
Downloaded: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.pom (525 B at 1.0 KB/sec)
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/internal/com/globalscalingsoftware/rsscon/rssconjava/1.2/rssconjava-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/snapshots/com/globalscalingsoftware/rsscon/rssconjava/1.2/rssconjava-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava/1.2/rssconjava-1.2.pom
Downloaded: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava/1.2/rssconjava-1.2.pom
(2 KB at 6.0 KB/sec)
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/internal/com/globalscalingsoftware/rsscon/rssconjava-
impl/1.2/rssconjava-impl-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/snapshots/com/globalscalingsoftware/rsscon/rssconjava-
impl/1.2/rssconjava-impl-1.2.pom
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
impl/1.2/rssconjava-impl-1.2.pom
Downloaded: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
impl/1.2/rssconjava-impl-1.2.pom (889 B at 24.8 KB/sec)
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/internal/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.jar
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/snapshots/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.jar
Downloading: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.jar
Downloaded: https://globalscalingsoftware-
projects.com/archiva/repository/globalscaling.com/com/globalscalingsoftware/rsscon/rssconjava-
api/1.2/rssconjava-api-1.2.jar (4 KB at 9.7 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ qhdriver-native
---
[INFO] Deleting /read/projects/com.globalscalingsoftware/qhdriver/qhdriver-
parent/qhdriver-native/target
[INFO]
[INFO] --- gmaven-plugin:1.3:generateStubs (default) @ qhdriver-native ---
[INFO] No sources found for Java stub generation
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @
qhdriver-native ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ qhdriver-
native ---
[INFO] Compiling 11 source files to
/read/projects/com.globalscalingsoftware/qhdriver/qhdriver-parent/qhdriver-
native/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /read/projects/com.globalscalingsoftware/qhdriver/qhdriver-
parent/qhdriver-
native/src/main/java/com/globalscalingsoftware/qhdriver/internal/InternalModule.java:
[9,48] package com.globalscalingsoftware.rsscon.internal does not exist
[ERROR] /read/projects/com.globalscalingsoftware/qhdriver/qhdriver-
parent/qhdriver-
native/src/main/java/com/globalscalingsoftware/qhdriver/internal/InternalModule.java:
[16,30] cannot find symbol
symbol : class RssconDriverImpl
location: class com.globalscalingsoftware.qhdriver.internal.InternalModule
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] qhdriver-parent ................................... SUCCESS [1.344s]
[INFO] qhdriver-native ................................... FAILURE [6.614s]
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 8.130s
[INFO] Finished at: Tue Apr 05 18:59:17 CEST 2011
[INFO] Final Memory: 10M/129M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-
plugin:2.3.2:compile (default-compile) on project qhdriver-native: Compilation
failure: Compilation failure:
[ERROR] /read/projects/com.globalscalingsoftware/qhdriver/qhdriver-
parent/qhdriver-
native/src/main/java/com/globalscalingsoftware/qhdriver/internal/InternalModule.java:
[9,48] package com.globalscalingsoftware.rsscon.internal does not exist
[ERROR] /read/projects/com.globalscalingsoftware/qhdriver/qhdriver-
parent/qhdriver-
native/src/main/java/com/globalscalingsoftware/qhdriver/internal/InternalModule.java:
[16,30] cannot find symbol
[ERROR] symbol : class RssconDriverImpl
[ERROR] location: class
com.globalscalingsoftware.qhdriver.internal.InternalModule
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the
command
[ERROR] mvn <goals> -rf :qhdriver-native
--
Erwin Mueller, ***@deventm.org
http://www.global-scaling-institute.de/
http://www.deventm.org

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