开发者

.net Solution structure with Maven?

I'm currently working with a Maven based project (lets call it Core) in Java and we have currently split it out into the following modules:

  • Core
  • Core.Integration

Im currently using IntelliJ as my IDE and they all build and have their own pom files (the Core project also contains the unit tests). Although the only module that has a usable output is the Core one, Core.Integration is only used to integration test Core with other projects so there is no real output from this module.

We have put Core.Integration as its own module rather than using the test folder within core, as it has additional dependencies such as another internal project (lets call it ThirdParty), so to prove that Core works with ThirdParty we have a suite of integration tests. The Core module doesn't need to know about ThirdParty and the unit tests do not have a need to use this other project, so as there is only 1 test scope within Maven we do not wish to dirty the Core module with this dependency.

SO... now we know why we have got this separate integration testing module, I will get to the main problem...

Lets say that the Core module itself builds fine and all unit tests pass, you then discover however that there is a failing test within the Core.Integration module. Providing you had both of these modules open, you could realise this and not deploy your change until you fixed the failing test. However some of the other IDEs only open one module and you have to manually tell it to include the others, so lets say a developer checks out the project, and then loads up the Core module, but doesn't bother including the integration test module as he doesn't need it for the moment, he makes a change it all passes and he deploys. At this point the build is broken and we have to re-visit why and where its all broken.

Within .net you have the idea of a solution and many projects within that, if one of those projects fails, the solution fails. So taking the above approach and applying it to .net (pretending we have a solution called "Core" too). If we were to check out our solution and open it, we would automatically see all child projects, then if we make the same change and build the solution it tells us it has failed as one of the child projects has failed. THIS is what im after, the idea of a parent solution which has many child开发者_运维知识库ren models that will always be loaded together, then if one fails it all fails, so the feedback on the breaking tests are given before its too late. Whereas at the moment they are just seem as individual modules with no link.

My other problem is also different developers use different IDEs (i.e IntelliJ, Eclipse, Netbeans) so if this sort of project structure is possible using a Maven style pom approach then I need it so different IDEs should recognise this without manual steps of having to include other modules etc...

Sorry for alot of waffle in there, but wanted to give a fuller context to the specific problem and project structure.


After ages looking around this, seems you cannot really do it without hacking up certain IDEs or project files.

Ideally I wanted

MyProject | - MyProject.Core | - MyProject.IntegrationTests

So if anything failed MyProject would be classed as a failed build...

I have instead given in and gone for

  • MyProject.Core
  • MyProject.IntegrationTests

and if one fails I just use common sense and decide its a failed build...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜