maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From angelo moreschini <>
Subject maven - using multiple src directories
Date Tue, 31 Jul 2018 08:49:08 GMT

I am new to maven.

Actually I am able to compile and run a simple java project (if all the
classes are in the same source directory).

As well this, to progress in my learning (because the java language have
the package structure to group classes inside directories)  I need to be
able to write java classes also inside multiple source directories.
*Maven give me error if I write java classes in different directories.....*

*How to do because this works ??*

Looking on Internet I found this article :

there is the suggestion of modify the pom file in this way:

  <sourceDirectory>src/main/java, src/interfaces,


Because I did it , maven now works (I can get the file.jar). ..

But I am not able to run the file .jar , after I got it..

*(using the command : <java -jar osmwse.jar>)*

I get the error :

*Error: Could not find or load main class*

nothing changed in the file... (only the pom file changed.).

*I think maven have to be able to mange (in a simple way) projects with
source code wrote on multiple directories...*

how to do it ???

Thank you


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message