Good day to you, Wouter,

Try running a mvn compile -X ( or mvn compile --debug ) with the build that
was failing ( the one configured with /../.. ). Then try looking for the
line "[INFO] [compiler:compile]". That's the part when the compiling of your
main java files starts. From there, search below for something like "[DEBUG]
Source directories: ...." It will tell you the source directory maven is
using. Then verify if it is your desired source directory.

Then compare that builds source directory with that of the build that was
passing ( by doing the same thing with the build using ${basedir}/../.. ).  

Most probably, the build using ${basedir}/../.. has its source directory set
to your desired location.

Cheers,
Franz


Wouter Boers-2 wrote:
> 
> Hi Siegfried,
> 
> @2: Yes I know its not the preferred/recommended way to set up maven. I
> don't like it either but as said before its a migration project so
> sometimes
> you have to cut corners.
> 
> As for the ${basedir}/../.. that helped. Don't ask me why but it did solve
> the problem so thanks for the pointer. Shame I did not think of that :)
> 
> Any explanation why this does work... I always want/like to know why.
> 
> Regards, Wouter
> 
> On 1/10/07, Siegfried Goeschl <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> 1) you can try to run help:effective-pom and help:effective-settings to
>> look at your complete POM and current settings
>>
>> 2) looking at your snippet it seems that the source code is NOT located
>> in the project but in somewhere else in the directory tree. This is not
>> the recommended way to setup a Maven project. Maybe using
>> ${basedir}/../.. might help.
>>
>> Cheers,
>>
>> Siegfried Goeschl
>>
>>
>>
>> Wouter Boers wrote:
>> > Hi,
>> >
>> > I am migrating a rather large project to maven2 and while doing that I
>> run
>> > into a very strange problem I cannot explain.
>> >
>> > The source directory location cannot be changed due to migration issues
>> > so I
>> > set the source dir in the pom.xml as follows:
>> >
>> >  <build>
>> >
>> >
>> <sourceDirectory>../../code/basisverzekeringApplicationModuleCode/</sourceDirectory>
>> >
>> >  </build>
>> >
>> > When compiling the sources (mvn clean compile with jdk 1.4.2_08) maven
>> > finds
>> > 1006 source files and fails to build while in the IDE (eclipse) no
>> problem
>> > exists.
>> >
>> > So just for test purposed I manually copied the sources to the default
>> > location (src/main/java) and used:
>> >
>> >  <build>
>> >    <!--
>> >
>> >
>> <sourceDirectory>../../code/basisverzekeringApplicationModuleCode/</sourceDirectory>
>> >
>> >    -->
>> >  </build>
>> >
>> > To my surprise, maven located 1018 files and compiled successfully!
>> >
>> > Can someone explain to me why with the sourcedirectory set maven found
>> 1006
>> > files and with the default, maven located 1018 files.
>> >
>> > Obviously its missing some sources files and hence fails to  compile
>> but
>> > why
>> > it is missing the files? Are there default filters ative when setting
>> > setting the source directory.
>> >
>> > I have 'verbosed' the compiler
>> >
>> >      <plugin>
>> >        <groupId>org.apache.maven.plugins</groupId>
>> >        <artifactId>maven-compiler-plugin</artifactId>
>> >        <configuration>
>> >          <compilerArguments>
>> >            <verbose />
>> >          </compilerArguments>
>> >          <configuration>
>> >            <source>1.4</source>
>> >            <target>1.4</target>
>> >          </configuration>
>> >        </configuration>
>> >      </plugin>
>> >
>> > so see with files maven passes to the compiler and I indeed can see
>> which
>> > files its missing but I have no clue why (no pattern in the filenames
>> of
>> > the
>> > missing files).
>> >
>> > And to make matters worse, if I use jdk 1.5 the difference is even more
>> > shocking. Maven then only find 894 files instead of the required 1018.
>> >
>> > Do anyone have any clue because I am lost here completely.
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Maven2-incorrectly-locates-sources-tf2952482s177.html#a8260924
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to