简体   繁体   中英

Converting Maven project to Gradle

I'm quite new to gradle and I can't really find a solution to my problem. I have searched across the web to see anyone has done something similar following best practices.

I have several java projects being built with maven sharing a single project that contains all the environment profiles. So it looks like

Environment Project
---- pom.xml
---- config
-------- dev.properties
-------- stage.properties
-------- prod.properties
Project A
---- pom.xml
---- src
-------- main
------------ java
------------ resources
-------- test
------------ java
------------ resources
Project B
---- pom.xml
---- src
-------- main
------------ java
------------ resources
-------- test
------------ java
------------ resources
Project C
---- pom.xml
---- src
-------- main
------------ java
------------ resources
-------- test
------------ java
------------ resources

and so on.

Using profiles in maven I was able to build environment specific packages. At that time of doing the project structure I didn't really pay attention to see if this was best practice.

Anyways, what I want to know is if there is a similar approach to gradle to generate environment specific packages whilst sharing the config across multiple projects.

I found this plugin gradle-properties-plugin which turned out to be exactly what i was after.

By default its simple enough to quickly implement environment based properties.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM