You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by SHAILJA <sh...@gmail.com> on 2009/01/21 08:33:09 UTC

compiltaion of .java problem

 Hi,

 I have  directory strucute like this
    
             a/b
            a/c
            a/d.java
            a/e.java


I have one pom.xml  under "a" directory .. Having code for compilation and
redirecting directories from there 
Like

m
4.0.0
a
1.0
pom	

b
c



 ${TOPDIR}/${JAVA_CLASSES_SRC}/${CUR_DIR} -- all properties are defined 
 ${TOPDIR}/${JAVA_CLASSES_DEST}

${basedir}/test
${TOPDIR}/${JAVA_CLASSES_DEST}

------- code for compilation----->
 
   maven-compiler-plugin 
----------------






What  happen when I do  mvn compile ,under "a " directory .. Directories b
and c get compiled  but not all .java files under a
  means a/d.java and a/e.java is not getting compild .  WHY ? Plz help me

-- 
View this message in context: http://www.nabble.com/compiltaion-of-.java-problem-tp21578305p21578305.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: compiltaion of .java problem

Posted by Tim Kettler <ti...@udo.edu>.
SHAILJA schrieb:
>  Hi,

Hi,

>  I have  directory strucute like this
>     
>              a/b
>             a/c
>             a/d.java
>             a/e.java

Understood.

> I have one pom.xml  under "a" directory .. Having code for compilation and
> redirecting directories from there 
> Like
> 
> m
> 4.0.0
> a
> 1.0
> pom	
> 
> b
> c
> 
> 
> 
>  ${TOPDIR}/${JAVA_CLASSES_SRC}/${CUR_DIR} -- all properties are defined 
>  ${TOPDIR}/${JAVA_CLASSES_DEST}
> 
> ${basedir}/test
> ${TOPDIR}/${JAVA_CLASSES_DEST}
> 
> ------- code for compilation----->
>  
>    maven-compiler-plugin 
> ----------------
> 

If this should somehow represent the contents of your a/pom.xml it's 
just plainly unreadable. The chances that someone on this list will help 
you are much higher if you post the pom in some more readable format, 
like just pasting the actual xml content.

> 
> 
> 
> What  happen when I do  mvn compile ,under "a " directory .. Directories b
> and c get compiled  but not all .java files under a
>   means a/d.java and a/e.java is not getting compild .  WHY ? Plz help me
> 

As far as I can guess from the crippled pom information above, the root 
of your problem is that you want to compile code in the aggregation pom 
  (which has its packaging element set to pom and a modules tag for your 
modules b and c). This will not work out of the box and (and in my 
opinion) is bad style.

Each packaging type has an associated build lifecycle [1]. The default 
lifecycle for pom packagings just doesn't compile any code or does any 
other useful stuff for projects containing java code. What you should do 
is move the java code contained directly under a/ to its own module and 
use the a/pom.xml just for aggregation of the submodules.

If that's not an option for you, you will have to configure each step of 
the build pocess by yourself (bind the compiler plugin to the compile 
phase, bind the jar plugin to the package phase, ...) To make this 
clear: I  discourage you from doing this. I strongly recommed you 
reconsider your current project structure and move the top level java 
code to its own module. And while you're at it, it might be worth to 
also refactor the directory layout to the standard layout [2] proposed 
by maven.

-Tim

[1] 
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

[2] 
http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

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