Sub-Modules Properties Files

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sub-Modules Properties Files

Kyle Smith
Hi Sonar Users,

I have a properties file with modules defined and am receiving this error:
Caused by: The source directory does not correspond to the package declaration

My properties file is basically like this:

sonar.projectKey=MyProject:Web
sonar.projectName=My Project
sonar.projectVersion=1.0

sonar.modules=my_module


my_module.sonar.projectName=MyProject_2
my_module.sonar.projectBaseDir= Folder1/Folder2/Folder3/Folder4
my_module.sonar.language= java
my_module.sonar.sources= com/program/java/hello/

sonar.host.url=http://localhost:9000

sonar.binaries=bin/folder-bin/

sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
sonar.jdbc.driver=com.mysql.jdbc.Driver
sonar.jdbc.username:MrAnderson
sonar.jdbc.password:TheMatrix




--------------------------end properties file-------------------------------------

the package statement in the java source file would be this: com.program.java.hello

However, sonarqube gives the same error that source declaration does not correspond to the package but it seems as though it completely does. Does anyone know what is going on here?
Reply | Threaded
Open this post in threaded view
|

Re: Sub-Modules Properties Files

G. Ann Campbell
This line is your problem:

my_module.sonar.sources= com/program/java/hello/

You don't want to point it directly at the class files themselves, but at the directory which holds the top-level "com/", "org/", &etc. directories.

So:

my_module.sonar.projectName=MyProject_2
my_module.sonar.projectBaseDir= Folder1/Folder2/Folder3/Folder4
my_module.sonar.language= java   # optional
my_module.sonar.sources= .



On Thu, Jul 3, 2014 at 2:38 PM, What_Just_Happened <[hidden email]> wrote:
Hi Sonar Users,

I have a properties file with modules defined and am receiving this error:
*Caused by: The source directory does not correspond to the package
declaration *

My properties file is basically like this:

sonar.projectKey=MyProject:Web
sonar.projectName=My Project
sonar.projectVersion=1.0

sonar.modules=my_module


my_module.sonar.projectName=MyProject_2
my_module.sonar.projectBaseDir= Folder1/Folder2/Folder3/Folder4
my_module.sonar.language= java
my_module.sonar.sources= com/program/java/hello/

sonar.host.url=http://localhost:9000

sonar.binaries=bin/folder-bin/

sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8
sonar.jdbc.driver=com.mysql.jdbc.Driver
sonar.jdbc.username:MrAnderson
sonar.jdbc.password:TheMatrix




--------------------------end properties
file-------------------------------------

the package statement in the java source file would be this:
com.program.java.hello

However, sonarqube gives the same error that source declaration does not
correspond to the package but it seems as though it completely does. Does
anyone know what is going on here?



--
View this message in context: http://sonarqube.15.x6.nabble.com/Sub-Modules-Properties-Files-tp5026327.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
G. Ann CAMPBELL | SonarSource