java - Maven compile multi-module project with cyclic dependencies -


I am working on my small OS S project, in which I am using Maven as a build tool. I split this project into smaller sub-projects to make development easier. Thus I have the structure:

  project + - main-module | | | + - pom.xml | + - submodule1 | | | + - pom.xml | + Pom.xml  

I believed that the interface should be provided to main module , which would be implemented to plug each application into a full application needed. Therefore context reference dependency references to submodule1 / pom.xml have main-module . In return, I should be able to test the whole application and thus include the test liability dependency reference for main-module / pom.xml for submodule1 . As a result, Maven denies compiling projects that they keep cyclical references.

I believed Maven could compile the first main module because it does not require the time of any compilation, depending on any submodules, then it Using compiled squares of main module, , it can compile classes of submodule1 and then compile the test class of main module > ( Capable run tests) but it seems that meow Not takes under dependence compiler account and I need to work around it.

The only solution I can see is to move the tests from the main module which really does not matter to me because only the main argument is provided to that module Does.

My question - There is no other way around this issue, besides to overcome the tests? Or maybe there is something wrong in my understanding that how Maven-reactor-plugin should work?

Removing your test, you can move all of your APIs into your own module. After that there is an application in your main module and you can easily distribute it to your app's API so that others can access it. If they want to develop new functionality, they do not need the sources of your app.

I consider it a better genre, because the sub-modules with specific functionality are now clearly what the code according to the requirement of your application APIs startup / shutdown, etc.

It's in my mind how Maven should look like projects. It sticks to the single responsibility principle, the responsibility of the main module is startup / shutdown, etc. for your application. The responsibility of the API module shows how other developers can access your app. And other subloads provide specific functionality for your app.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -