eclipse-archived / smarthome

Eclipse SmartHomeâ„¢ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
864 stars 782 forks source link

Non-maven directory structure of part of the project #4757

Open martinvw opened 6 years ago

martinvw commented 6 years ago

Do you know of a reason that some directories do not follow the maven convention of having a src/main/java but instead have a src with the code directly inside, An example of this is https://github.com/eclipse/smarthome/tree/master/bundles/model/org.eclipse.smarthome.model.rule.runtime but actually the majority of folders inside https://github.com/eclipse/smarthome/tree/master/bundles/model does this.

The problem is that this break compatibility with other IDE's (yes I know this is an Eclipse project 😉 )

And can we (still) refactor this or maybe update the pom.xml's so that we inform maven about moving the source path I think that my IDE will also support it in that case.

martinvw commented 6 years ago

See also errors like:

[INFO] --- maven-scr-plugin:1.24.0:scr (generate-scr-scrdescriptor) @ org.eclipse.smarthome.model.thing ---
[WARNING] Source tree does not exist. Ignoring D:\Documents\_Martin\Java\openhab\git\smarthome\bundles\model\org.eclipse.smarthome.model.thing\src\main\java
[WARNING] Source tree does not exist. Ignoring D:\Documents\_Martin\Java\openhab\git\smarthome\bundles\model\org.eclipse.smarthome.model.thing\src\main\groovy
[WARNING] Source tree does not exist. Ignoring D:\Documents\_Martin\Java\openhab\git\smarthome\bundles\model\org.eclipse.smarthome.model.thing\src\main\java
[WARNING] Source tree does not exist. Ignoring D:\Documents\_Martin\Java\openhab\git\smarthome\bundles\model\org.eclipse.smarthome.model.thing\src\main\groovy
maggu2810 commented 6 years ago

The model bundles are very special as code is generated by Xtext files etc. If you succeed with a move from src to src/main/java, so the model generation and compilation works in the Eclipse IDE and in Maven I don't see any reason not to move. But we need to ensure that the Eclipse IDE mwe Tasks and compilation are still working.

sjsf commented 6 years ago

I haven't figured out yet if there are any drawbacks, but just for the record, there is the following configuration parameter for the generator (*.mwe2-files):

project = StandardProjectConfig {
    // ...     
    mavenLayout = true
    // ...     
}

This AFAIK is what it needs in order to change the file structure.