AFAIK нет инструмента, который делает это. Но вы можете использовать Maven Archetype (опция командной строки maven) для создания многомодульного проекта ( агрегатор-стиль ).
Я приведу пример проекта maven multi module . Я думаю, что будет так же, как вы можете сделать это для Gradle или других инструментов, отрегулируйте свой код
Создайте архетип из многомодульного проекта
Создание архетипа для многомодульного проекта так же просто, как создание одного для одномодульного проекта.
Просто перейдите в корневой каталог многомодульного проекта и вызовите его mvn archetype:create-from-project
. В архетипе, используемом в качестве примера, некоторые файлы должны быть нефильтрованными. Это достигается путем предоставления плагину архетипа некоторых значений в archetype.filteredExtensions
свойстве.
$ mvn archetype:create-from-project -Darchetype.filteredExtensions=java
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] archetype
[INFO] archetype :: business domain model
[INFO] archetype :: business services
[INFO] archetype :: persistence layer
[INFO] archetype :: infrastructure
[INFO] archetype :: remoting
[INFO] archetype :: web services
[INFO] archetype :: web application
[INFO] archetype :: enterprise application
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype
[INFO] task-segment: [archetype:create-from-project] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:create-from-project
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype :: business domain model
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype :: business services
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype :: persistence layer
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype :: infrastructure
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype :: remoting
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype :: web services
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype :: web application
[INFO] ------------------------------------------------------------------------
[INFO] [gwt:eclipse {execution: default}]
[INFO] Unpack native libraries required to run hosted browser
[INFO] [gwt:generateAsync {execution: default}]
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype :: enterprise application
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:create-from-project]
[INFO] Setting default groupId: com.capgemini.archetype
[INFO] Setting default artifactId: archetype
[INFO] Setting default version: 1.0.0-SNAPSHOT
[INFO] Setting default package: com.capgemini
[INFO] Archetype created in target/generated-sources/archetype
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Mon Sep 15 19:11:17 CEST 2008
[INFO] Final Memory: 19M/36M
[INFO] ------------------------------------------------------------------------
Также посмотрите на
-
http://www.scala-sbt.org/0.12.2/docs/Getting-Started/Multi-Project.html
-
https://github.com/laurilehmijoki/scala-multimodule-sample-project/blob/master/pom.xml