You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jeff Mutonho <ej...@gmail.com> on 2006/11/14 10:46:49 UTC

jars not being included in compiler classpath

I have a small proof of concept I'm trying to build.In the project's
super pom , I have a dependency to spring specified as

  <dependency>
      <groupId>oracle.ldap</groupId>
      <artifactId>ldapjclnt</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>javax.j2ee</groupId>
      <artifactId>j2ee</artifactId>
      <version>1.3.0</version>
    </dependency>
   <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring</artifactId>
      <version>1.2.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.13</version>
      <scope>test</scope>
    </dependency>


However when I run the build I'm getting build failure due to failed
dependencies on the spring-1.2.3.jar and the log4j-1.2.13.jar  files.

A snippet of the log shows that these two jars are not being passed to
the maven-compiler-plugin 's classpath :

[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-compiler-plugin:2.0.1:compile' -->
[DEBUG]   (f) basedir =
C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal
[DEBUG]   (f) buildDirectory =
C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target
[DEBUG]   (f) classpathElements =
[C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes,
D:\Documents and
Settings\mutonhj\.m2\repository\javax\j2ee\j2ee\1.3.0\j2ee-1.3.0.jar,
D:\Documents and
Settings\mutonhj\.m2\repository\oracle\ldap\ldapjclnt\1.0\ldapjclnt-1.0.jar]
[DEBUG]   (f) compileSourceRoots =
[C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src]
[DEBUG]   (f) compilerId = javac
[DEBUG]   (f) debug = true
[DEBUG]   (f) fork = false
[DEBUG]   (f) optimize = false
[DEBUG]   (f) outputDirectory =
C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes
[DEBUG]   (f) outputFileName = dev-ep1x-eportal-1.0.0
[DEBUG]   (f) projectArtifact =
za.co.pragmaticus.dev-ep1x.eportal:dev-ep1x-eportal:ejb:1.0.0
[DEBUG]   (f) showDeprecation = false
[DEBUG]   (f) showWarnings = false
[DEBUG]   (f) staleMillis = 0
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[INFO] [compiler:compile]
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories:
[C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src]
[DEBUG] Classpath:
[C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes
 D:\Documents and
Settings\mutonhj\.m2\repository\javax\j2ee\j2ee\1.3.0\j2ee-1.3.0.jar
 D:\Documents and
Settings\mutonhj\.m2\repository\oracle\ldap\ldapjclnt\1.0\ldapjclnt-1.0.jar]
[DEBUG] Output directory:
C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes
[DEBUG] Classpath:
[DEBUG]  C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes
[DEBUG]  D:\Documents and
Settings\mutonhj\.m2\repository\javax\j2ee\j2ee\1.3.0\j2ee-1.3.0.jar
[DEBUG]  D:\Documents and
Settings\mutonhj\.m2\repository\oracle\ldap\ldapjclnt\1.0\ldapjclnt-1.0.jar
[DEBUG] Source roots:
[DEBUG]  C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src
Compiling 392 source files to
C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

.........

C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src\za\co\pragmaticus\portal\controllers\ApplicationPDCRegistrationController.java:[5,24]
package org.apache.log4j does not exist

C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src\za\co\pragmaticus\portal\controllers\ApplicationPDCRegistrationController.java:[6,43]
package org.springframework.web.servlet.mvc does not exist

C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src\za\co\pragmaticus\portal\controllers\ApplicationPDCRegistrationController.java:[7,44]
package org.springframework.web.servlet.view does not exist

C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src\za\co\pragmaticus\portal\controllers\ApplicationPDCRegistrationController.java:[8,39]
package org.springframework.web.servlet does not exist

C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src\za\co\pragmaticus\portal\controllers\ApplicationPDCRegistrationController.java:[10,41]
package org.springframework.beans.factory does not exist


This does not seem to make any sense , because the other 2 jars in my
dependency configuration , namely  ldapjclnt-1.0.jar and
j2ee-1.3.0.jar , are included in the build classpath.

-- 

Jeff  Mutonho
Cape Town
South Africa

GoogleTalk : ejbengine
Skype        : ejbengine
Registered Linux user number 366042

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


Re: jars not being included in compiler classpath

Posted by Jeff Mutonho <ej...@gmail.com>.
Thanx ...much appreciated

Jeff  Mutonho
Cape Town
South Africa

GoogleTalk : ejbengine
Skype        : ejbengine
Registered Linux user number 366042

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


Re: jars not being included in compiler classpath

Posted by Geoffrey De Smet <ge...@gmail.com>.
Yep, but it seems your mixing your main sources and your test sources 
into one dir: /src.
So a normal compile also tries to compile the test sources.
You're better off splitting the sources directories up:
/src/main/java
/src/main/resources
/src/test/java
/src/test/resources

Jeff Mutonho wrote, On 2006-11-14 11:03 AM:
> On 11/14/06, Wayne Fay <wa...@gmail.com> wrote:
>> Scope test is not included in build classpath. Both "problem" jars are
>> scoped "test". The others have no scope so they default to "compile".
>>
>> Wayne
>>
> 
> I get  confused by the scope thing.If scope is test , does that mean
> the jars will only be used in the test phase of the build lifecycle?
> 
> Jeff  Mutonho
> Cape Town
> South Africa
> 
> GoogleTalk : ejbengine
> Skype        : ejbengine
> Registered Linux user number 366042

-- 
With kind regards,
Geoffrey De Smet


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


Re: jars not being included in compiler classpath

Posted by Mark Struberg <st...@yahoo.de>.
> I get  confused by the scope thing.If scope is test
> , does that mean
> the jars will only be used in the test phase of the
> build lifecycle?

Exactly, they are only available for the phases needed
for the test compile, executing the test and building
the test reports.

This are the following phases of the default lifecycle
(more at
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
)
.) generate-test-sources
.) process-test-sources
.) generate-test-resources
.) process-test-resources
.) test-compile
.) test
and for what i know also the integration test phases:
.) pre-integration-test
.) integration-test
.) post-integration-test

plus the phases from the site lifecycle (for building
test reports)

lg,
strub

--- Jeff Mutonho <ej...@gmail.com> schrieb:

> On 11/14/06, Wayne Fay <wa...@gmail.com> wrote:
> > Scope test is not included in build classpath.
> Both "problem" jars are
> > scoped "test". The others have no scope so they
> default to "compile".
> >
> > Wayne
> >
> 
> I get  confused by the scope thing.If scope is test
> , does that mean
> the jars will only be used in the test phase of the
> build lifecycle?
> 
> Jeff  Mutonho
> Cape Town
> South Africa
> 
> GoogleTalk : ejbengine
> Skype        : ejbengine
> Registered Linux user number 366042
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> For additional commands, e-mail:
> users-help@maven.apache.org
> 
> 





	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de

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


Re: jars not being included in compiler classpath

Posted by Jeff Mutonho <ej...@gmail.com>.
On 11/14/06, Wayne Fay <wa...@gmail.com> wrote:
> Scope test is not included in build classpath. Both "problem" jars are
> scoped "test". The others have no scope so they default to "compile".
>
> Wayne
>

I get  confused by the scope thing.If scope is test , does that mean
the jars will only be used in the test phase of the build lifecycle?

Jeff  Mutonho
Cape Town
South Africa

GoogleTalk : ejbengine
Skype        : ejbengine
Registered Linux user number 366042

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


Re: jars not being included in compiler classpath

Posted by Wayne Fay <wa...@gmail.com>.
Scope test is not included in build classpath. Both "problem" jars are
scoped "test". The others have no scope so they default to "compile".

Wayne

On 11/14/06, Jeff Mutonho <ej...@gmail.com> wrote:
> I have a small proof of concept I'm trying to build.In the project's
> super pom , I have a dependency to spring specified as
>
>   <dependency>
>       <groupId>oracle.ldap</groupId>
>       <artifactId>ldapjclnt</artifactId>
>       <version>1.0</version>
>     </dependency>
>     <dependency>
>       <groupId>javax.j2ee</groupId>
>       <artifactId>j2ee</artifactId>
>       <version>1.3.0</version>
>     </dependency>
>    <dependency>
>       <groupId>org.springframework</groupId>
>       <artifactId>spring</artifactId>
>       <version>1.2.3</version>
>       <scope>test</scope>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.13</version>
>       <scope>test</scope>
>     </dependency>
>
>
> However when I run the build I'm getting build failure due to failed
> dependencies on the spring-1.2.3.jar and the log4j-1.2.13.jar  files.
>
> A snippet of the log shows that these two jars are not being passed to
> the maven-compiler-plugin 's classpath :
>
> [DEBUG] Configuring mojo
> 'org.apache.maven.plugins:maven-compiler-plugin:2.0.1:compile' -->
> [DEBUG]   (f) basedir =
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal
> [DEBUG]   (f) buildDirectory =
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target
> [DEBUG]   (f) classpathElements =
> [C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes,
> D:\Documents and
> Settings\mutonhj\.m2\repository\javax\j2ee\j2ee\1.3.0\j2ee-1.3.0.jar,
> D:\Documents and
> Settings\mutonhj\.m2\repository\oracle\ldap\ldapjclnt\1.0\ldapjclnt-1.0.jar]
> [DEBUG]   (f) compileSourceRoots =
> [C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src]
> [DEBUG]   (f) compilerId = javac
> [DEBUG]   (f) debug = true
> [DEBUG]   (f) fork = false
> [DEBUG]   (f) optimize = false
> [DEBUG]   (f) outputDirectory =
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes
> [DEBUG]   (f) outputFileName = dev-ep1x-eportal-1.0.0
> [DEBUG]   (f) projectArtifact =
> za.co.pragmaticus.dev-ep1x.eportal:dev-ep1x-eportal:ejb:1.0.0
> [DEBUG]   (f) showDeprecation = false
> [DEBUG]   (f) showWarnings = false
> [DEBUG]   (f) staleMillis = 0
> [DEBUG]   (f) verbose = false
> [DEBUG] -- end configuration --
> [INFO] [compiler:compile]
> [DEBUG] Using compiler 'javac'.
> [DEBUG] Source directories:
> [C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src]
> [DEBUG] Classpath:
> [C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes
>  D:\Documents and
> Settings\mutonhj\.m2\repository\javax\j2ee\j2ee\1.3.0\j2ee-1.3.0.jar
>  D:\Documents and
> Settings\mutonhj\.m2\repository\oracle\ldap\ldapjclnt\1.0\ldapjclnt-1.0.jar]
> [DEBUG] Output directory:
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes
> [DEBUG] Classpath:
> [DEBUG]
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes
> [DEBUG]  D:\Documents and
> Settings\mutonhj\.m2\repository\javax\j2ee\j2ee\1.3.0\j2ee-1.3.0.jar
> [DEBUG]  D:\Documents and
> Settings\mutonhj\.m2\repository\oracle\ldap\ldapjclnt\1.0\ldapjclnt-1.0.jar
> [DEBUG] Source roots:
> [DEBUG]
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src
> Compiling 392 source files to
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\target\classes
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Compilation failure
>
> .........
>
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src\za\co\pragmaticus\portal\controllers\ApplicationPDCRegistrationController.java:[5,24]
> package org.apache.log4j does not exist
>
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src\za\co\pragmaticus\portal\controllers\ApplicationPDCRegistrationController.java:[6,43]
> package org.springframework.web.servlet.mvc does not exist
>
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src\za\co\pragmaticus\portal\controllers\ApplicationPDCRegistrationController.java:[7,44]
> package org.springframework.web.servlet.view does not exist
>
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src\za\co\pragmaticus\portal\controllers\ApplicationPDCRegistrationController.java:[8,39]
> package org.springframework.web.servlet does not exist
>
> C:\pragmaticus-sea-ias\eclipse-3.1.2-workspaces\dev-ep1x\eportal\src\za\co\pragmaticus\portal\controllers\ApplicationPDCRegistrationController.java:[10,41]
> package org.springframework.beans.factory does not exist
>
>
> This does not seem to make any sense , because the other 2 jars in my
> dependency configuration , namely  ldapjclnt-1.0.jar and
> j2ee-1.3.0.jar , are included in the build classpath.
>
> --
>
> Jeff  Mutonho
> Cape Town
> South Africa
>
> GoogleTalk : ejbengine
> Skype        : ejbengine
> Registered Linux user number 366042
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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