How to deploy Multi module maven spring boot project in pivotal Cloud foundry?
up vote
2
down vote
favorite
I have a multi maven module spring boot project. Lets say, there are 2 modules in the parent 'service' and 'config'. Service depends on config. config module contains classes for DB configuration code ( cassandra db).
I added config module as dependency in my service module's pom. Sprinngboot application runs fine in local.
Parent pom has packaging as pom. submodules ie. Service and config have packaging as jar. I don't need to create any war as there is no webapp required. its just rest microservices.
To package the project, I executed'mvn package' at root pom level. It created jars for individual modules. service module is the one where main method is defined.
I created manifest file at service module level and deployed the jar of service module in cloud. App ran fine on cloud as well. I believe jar of service module implicitly contains required dependencies from config module as i have already defined config as dependency in service module's pom.
Next, in case I want to make some modification in config module only, would it still require creating the jar of service and deploy that in cloud even if there is no change in service?
Or
Is there a way i can deploy jar of config module only in cloud? if yes, how would I bind my service module with that in cloud to keep it functioning as before?
What is the recommended way for cloud deployment of multimaven project?
Edit:1
To make the question more clear and precise, I am looking for standard way of deployment in cloud. i am putting up the steps how I am doing the deployment at present and with reference to that what betterment i should do in the current steps.
I am having 3 pom.xml files. 1 parent and 2 childs. Also, config module is defined as dependency in service module's pom.xml
For deployment below steps i am taking-
- Going to path of parent pom and running 'mvn package'
It creates respective jars in child modules ( 1 jar in service and, 1 jar in config) - creating a manisfest.yml file in service module and putting up path of service jar along with other required configuration in manifest file.
- Logging into cloud foundry, navigating to path of service module where manifest .yml file is present and executing 'cf push'
It deploys and starts my app in cloud. All good!
Next, lets say i make modification in config module class code. How can I just deploy the jar of config module in cloud? Would my app still work?
Previously I had deployed only service module's jar and not the config module's jar. App runs fine. But in future if i make changes in config module only and i don't touch service module, would I still need to create jar of service as i did initially or there is a way i just re create jar for config module which is modified and deploy that only.
maven spring-boot pivotal-cloud-foundry
add a comment |
up vote
2
down vote
favorite
I have a multi maven module spring boot project. Lets say, there are 2 modules in the parent 'service' and 'config'. Service depends on config. config module contains classes for DB configuration code ( cassandra db).
I added config module as dependency in my service module's pom. Sprinngboot application runs fine in local.
Parent pom has packaging as pom. submodules ie. Service and config have packaging as jar. I don't need to create any war as there is no webapp required. its just rest microservices.
To package the project, I executed'mvn package' at root pom level. It created jars for individual modules. service module is the one where main method is defined.
I created manifest file at service module level and deployed the jar of service module in cloud. App ran fine on cloud as well. I believe jar of service module implicitly contains required dependencies from config module as i have already defined config as dependency in service module's pom.
Next, in case I want to make some modification in config module only, would it still require creating the jar of service and deploy that in cloud even if there is no change in service?
Or
Is there a way i can deploy jar of config module only in cloud? if yes, how would I bind my service module with that in cloud to keep it functioning as before?
What is the recommended way for cloud deployment of multimaven project?
Edit:1
To make the question more clear and precise, I am looking for standard way of deployment in cloud. i am putting up the steps how I am doing the deployment at present and with reference to that what betterment i should do in the current steps.
I am having 3 pom.xml files. 1 parent and 2 childs. Also, config module is defined as dependency in service module's pom.xml
For deployment below steps i am taking-
- Going to path of parent pom and running 'mvn package'
It creates respective jars in child modules ( 1 jar in service and, 1 jar in config) - creating a manisfest.yml file in service module and putting up path of service jar along with other required configuration in manifest file.
- Logging into cloud foundry, navigating to path of service module where manifest .yml file is present and executing 'cf push'
It deploys and starts my app in cloud. All good!
Next, lets say i make modification in config module class code. How can I just deploy the jar of config module in cloud? Would my app still work?
Previously I had deployed only service module's jar and not the config module's jar. App runs fine. But in future if i make changes in config module only and i don't touch service module, would I still need to create jar of service as i did initially or there is a way i just re create jar for config module which is modified and deploy that only.
maven spring-boot pivotal-cloud-foundry
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have a multi maven module spring boot project. Lets say, there are 2 modules in the parent 'service' and 'config'. Service depends on config. config module contains classes for DB configuration code ( cassandra db).
I added config module as dependency in my service module's pom. Sprinngboot application runs fine in local.
Parent pom has packaging as pom. submodules ie. Service and config have packaging as jar. I don't need to create any war as there is no webapp required. its just rest microservices.
To package the project, I executed'mvn package' at root pom level. It created jars for individual modules. service module is the one where main method is defined.
I created manifest file at service module level and deployed the jar of service module in cloud. App ran fine on cloud as well. I believe jar of service module implicitly contains required dependencies from config module as i have already defined config as dependency in service module's pom.
Next, in case I want to make some modification in config module only, would it still require creating the jar of service and deploy that in cloud even if there is no change in service?
Or
Is there a way i can deploy jar of config module only in cloud? if yes, how would I bind my service module with that in cloud to keep it functioning as before?
What is the recommended way for cloud deployment of multimaven project?
Edit:1
To make the question more clear and precise, I am looking for standard way of deployment in cloud. i am putting up the steps how I am doing the deployment at present and with reference to that what betterment i should do in the current steps.
I am having 3 pom.xml files. 1 parent and 2 childs. Also, config module is defined as dependency in service module's pom.xml
For deployment below steps i am taking-
- Going to path of parent pom and running 'mvn package'
It creates respective jars in child modules ( 1 jar in service and, 1 jar in config) - creating a manisfest.yml file in service module and putting up path of service jar along with other required configuration in manifest file.
- Logging into cloud foundry, navigating to path of service module where manifest .yml file is present and executing 'cf push'
It deploys and starts my app in cloud. All good!
Next, lets say i make modification in config module class code. How can I just deploy the jar of config module in cloud? Would my app still work?
Previously I had deployed only service module's jar and not the config module's jar. App runs fine. But in future if i make changes in config module only and i don't touch service module, would I still need to create jar of service as i did initially or there is a way i just re create jar for config module which is modified and deploy that only.
maven spring-boot pivotal-cloud-foundry
I have a multi maven module spring boot project. Lets say, there are 2 modules in the parent 'service' and 'config'. Service depends on config. config module contains classes for DB configuration code ( cassandra db).
I added config module as dependency in my service module's pom. Sprinngboot application runs fine in local.
Parent pom has packaging as pom. submodules ie. Service and config have packaging as jar. I don't need to create any war as there is no webapp required. its just rest microservices.
To package the project, I executed'mvn package' at root pom level. It created jars for individual modules. service module is the one where main method is defined.
I created manifest file at service module level and deployed the jar of service module in cloud. App ran fine on cloud as well. I believe jar of service module implicitly contains required dependencies from config module as i have already defined config as dependency in service module's pom.
Next, in case I want to make some modification in config module only, would it still require creating the jar of service and deploy that in cloud even if there is no change in service?
Or
Is there a way i can deploy jar of config module only in cloud? if yes, how would I bind my service module with that in cloud to keep it functioning as before?
What is the recommended way for cloud deployment of multimaven project?
Edit:1
To make the question more clear and precise, I am looking for standard way of deployment in cloud. i am putting up the steps how I am doing the deployment at present and with reference to that what betterment i should do in the current steps.
I am having 3 pom.xml files. 1 parent and 2 childs. Also, config module is defined as dependency in service module's pom.xml
For deployment below steps i am taking-
- Going to path of parent pom and running 'mvn package'
It creates respective jars in child modules ( 1 jar in service and, 1 jar in config) - creating a manisfest.yml file in service module and putting up path of service jar along with other required configuration in manifest file.
- Logging into cloud foundry, navigating to path of service module where manifest .yml file is present and executing 'cf push'
It deploys and starts my app in cloud. All good!
Next, lets say i make modification in config module class code. How can I just deploy the jar of config module in cloud? Would my app still work?
Previously I had deployed only service module's jar and not the config module's jar. App runs fine. But in future if i make changes in config module only and i don't touch service module, would I still need to create jar of service as i did initially or there is a way i just re create jar for config module which is modified and deploy that only.
maven spring-boot pivotal-cloud-foundry
maven spring-boot pivotal-cloud-foundry
edited Nov 21 at 11:21
asked Nov 21 at 9:38
MaFiA
356
356
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
You need a parent project to hold it all together:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
<groupId>com.greg</groupId>
<artifactId>boot-multi-module-example</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>service</module>
<module>config</module>
</modules>
</project>
You need a config project as a child of the parent, something like:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>boot-multi-module-example</artifactId>
<groupId>com.greg</groupId>
<version>1.0</version>
</parent>
<artifactId>config</artifactId>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
And finally the boot application that you will deploy, with a dependency to the config service above:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.greg</groupId>
<artifactId>boot-multi-module-example</artifactId>
<version>1.0</version>
</parent>
<artifactId>service</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- tag::actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.greg</groupId>
<artifactId>service</artifactId>
<version>${project.version}</version>
</dependency>
<!-- end::actuator -->
<!-- tag::tests -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- end::tests -->
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@ Essex Boy, I actually already had the similar pom configurations. i have edited my question to make it more clear . Could you please have a look and provide the insights..thanks!
– MaFiA
Nov 21 at 11:19
add a comment |
up vote
0
down vote
Next, lets say i make modification in config module class code. How can I just deploy the jar of config module in cloud? Would my app still work?
It's not possible to do a partial deploy to Cloud Foundry. By this I mean that you can't take one JAR file from your app and swap that into the existing application code bundle. You need to do a cf push
every time you're changing code, no matter how small the change.
When you run cf push
you are sending a "complete" bundle of application code to Cloud Foundry to run. If you change any part of that complete bundle, you need to cf push
again. This may sound inefficient but cf push
is smart and skip files that are already on the server, so you'll notice that subsequent pushes are smaller and faster.
You do still need to stage & restart the application though. This is unavoidable as you cannot change an application in-place. This would make a snowflake, or app that has diverged from it's droplet, and that's considered bad practice.
Long story short...
- Rebuild the module that changed.
- Rebuild the JAR/WAR that you are pushing to Cloud Foundry.
- Push to Cloud foundry
Your changes will be deployed.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You need a parent project to hold it all together:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
<groupId>com.greg</groupId>
<artifactId>boot-multi-module-example</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>service</module>
<module>config</module>
</modules>
</project>
You need a config project as a child of the parent, something like:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>boot-multi-module-example</artifactId>
<groupId>com.greg</groupId>
<version>1.0</version>
</parent>
<artifactId>config</artifactId>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
And finally the boot application that you will deploy, with a dependency to the config service above:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.greg</groupId>
<artifactId>boot-multi-module-example</artifactId>
<version>1.0</version>
</parent>
<artifactId>service</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- tag::actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.greg</groupId>
<artifactId>service</artifactId>
<version>${project.version}</version>
</dependency>
<!-- end::actuator -->
<!-- tag::tests -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- end::tests -->
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@ Essex Boy, I actually already had the similar pom configurations. i have edited my question to make it more clear . Could you please have a look and provide the insights..thanks!
– MaFiA
Nov 21 at 11:19
add a comment |
up vote
1
down vote
You need a parent project to hold it all together:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
<groupId>com.greg</groupId>
<artifactId>boot-multi-module-example</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>service</module>
<module>config</module>
</modules>
</project>
You need a config project as a child of the parent, something like:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>boot-multi-module-example</artifactId>
<groupId>com.greg</groupId>
<version>1.0</version>
</parent>
<artifactId>config</artifactId>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
And finally the boot application that you will deploy, with a dependency to the config service above:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.greg</groupId>
<artifactId>boot-multi-module-example</artifactId>
<version>1.0</version>
</parent>
<artifactId>service</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- tag::actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.greg</groupId>
<artifactId>service</artifactId>
<version>${project.version}</version>
</dependency>
<!-- end::actuator -->
<!-- tag::tests -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- end::tests -->
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@ Essex Boy, I actually already had the similar pom configurations. i have edited my question to make it more clear . Could you please have a look and provide the insights..thanks!
– MaFiA
Nov 21 at 11:19
add a comment |
up vote
1
down vote
up vote
1
down vote
You need a parent project to hold it all together:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
<groupId>com.greg</groupId>
<artifactId>boot-multi-module-example</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>service</module>
<module>config</module>
</modules>
</project>
You need a config project as a child of the parent, something like:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>boot-multi-module-example</artifactId>
<groupId>com.greg</groupId>
<version>1.0</version>
</parent>
<artifactId>config</artifactId>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
And finally the boot application that you will deploy, with a dependency to the config service above:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.greg</groupId>
<artifactId>boot-multi-module-example</artifactId>
<version>1.0</version>
</parent>
<artifactId>service</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- tag::actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.greg</groupId>
<artifactId>service</artifactId>
<version>${project.version}</version>
</dependency>
<!-- end::actuator -->
<!-- tag::tests -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- end::tests -->
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
You need a parent project to hold it all together:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
<groupId>com.greg</groupId>
<artifactId>boot-multi-module-example</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>service</module>
<module>config</module>
</modules>
</project>
You need a config project as a child of the parent, something like:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>boot-multi-module-example</artifactId>
<groupId>com.greg</groupId>
<version>1.0</version>
</parent>
<artifactId>config</artifactId>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
And finally the boot application that you will deploy, with a dependency to the config service above:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.greg</groupId>
<artifactId>boot-multi-module-example</artifactId>
<version>1.0</version>
</parent>
<artifactId>service</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- tag::actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.greg</groupId>
<artifactId>service</artifactId>
<version>${project.version}</version>
</dependency>
<!-- end::actuator -->
<!-- tag::tests -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- end::tests -->
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
edited Nov 21 at 10:46
answered Nov 21 at 10:10
Essex Boy
4,3351815
4,3351815
@ Essex Boy, I actually already had the similar pom configurations. i have edited my question to make it more clear . Could you please have a look and provide the insights..thanks!
– MaFiA
Nov 21 at 11:19
add a comment |
@ Essex Boy, I actually already had the similar pom configurations. i have edited my question to make it more clear . Could you please have a look and provide the insights..thanks!
– MaFiA
Nov 21 at 11:19
@ Essex Boy, I actually already had the similar pom configurations. i have edited my question to make it more clear . Could you please have a look and provide the insights..thanks!
– MaFiA
Nov 21 at 11:19
@ Essex Boy, I actually already had the similar pom configurations. i have edited my question to make it more clear . Could you please have a look and provide the insights..thanks!
– MaFiA
Nov 21 at 11:19
add a comment |
up vote
0
down vote
Next, lets say i make modification in config module class code. How can I just deploy the jar of config module in cloud? Would my app still work?
It's not possible to do a partial deploy to Cloud Foundry. By this I mean that you can't take one JAR file from your app and swap that into the existing application code bundle. You need to do a cf push
every time you're changing code, no matter how small the change.
When you run cf push
you are sending a "complete" bundle of application code to Cloud Foundry to run. If you change any part of that complete bundle, you need to cf push
again. This may sound inefficient but cf push
is smart and skip files that are already on the server, so you'll notice that subsequent pushes are smaller and faster.
You do still need to stage & restart the application though. This is unavoidable as you cannot change an application in-place. This would make a snowflake, or app that has diverged from it's droplet, and that's considered bad practice.
Long story short...
- Rebuild the module that changed.
- Rebuild the JAR/WAR that you are pushing to Cloud Foundry.
- Push to Cloud foundry
Your changes will be deployed.
add a comment |
up vote
0
down vote
Next, lets say i make modification in config module class code. How can I just deploy the jar of config module in cloud? Would my app still work?
It's not possible to do a partial deploy to Cloud Foundry. By this I mean that you can't take one JAR file from your app and swap that into the existing application code bundle. You need to do a cf push
every time you're changing code, no matter how small the change.
When you run cf push
you are sending a "complete" bundle of application code to Cloud Foundry to run. If you change any part of that complete bundle, you need to cf push
again. This may sound inefficient but cf push
is smart and skip files that are already on the server, so you'll notice that subsequent pushes are smaller and faster.
You do still need to stage & restart the application though. This is unavoidable as you cannot change an application in-place. This would make a snowflake, or app that has diverged from it's droplet, and that's considered bad practice.
Long story short...
- Rebuild the module that changed.
- Rebuild the JAR/WAR that you are pushing to Cloud Foundry.
- Push to Cloud foundry
Your changes will be deployed.
add a comment |
up vote
0
down vote
up vote
0
down vote
Next, lets say i make modification in config module class code. How can I just deploy the jar of config module in cloud? Would my app still work?
It's not possible to do a partial deploy to Cloud Foundry. By this I mean that you can't take one JAR file from your app and swap that into the existing application code bundle. You need to do a cf push
every time you're changing code, no matter how small the change.
When you run cf push
you are sending a "complete" bundle of application code to Cloud Foundry to run. If you change any part of that complete bundle, you need to cf push
again. This may sound inefficient but cf push
is smart and skip files that are already on the server, so you'll notice that subsequent pushes are smaller and faster.
You do still need to stage & restart the application though. This is unavoidable as you cannot change an application in-place. This would make a snowflake, or app that has diverged from it's droplet, and that's considered bad practice.
Long story short...
- Rebuild the module that changed.
- Rebuild the JAR/WAR that you are pushing to Cloud Foundry.
- Push to Cloud foundry
Your changes will be deployed.
Next, lets say i make modification in config module class code. How can I just deploy the jar of config module in cloud? Would my app still work?
It's not possible to do a partial deploy to Cloud Foundry. By this I mean that you can't take one JAR file from your app and swap that into the existing application code bundle. You need to do a cf push
every time you're changing code, no matter how small the change.
When you run cf push
you are sending a "complete" bundle of application code to Cloud Foundry to run. If you change any part of that complete bundle, you need to cf push
again. This may sound inefficient but cf push
is smart and skip files that are already on the server, so you'll notice that subsequent pushes are smaller and faster.
You do still need to stage & restart the application though. This is unavoidable as you cannot change an application in-place. This would make a snowflake, or app that has diverged from it's droplet, and that's considered bad practice.
Long story short...
- Rebuild the module that changed.
- Rebuild the JAR/WAR that you are pushing to Cloud Foundry.
- Push to Cloud foundry
Your changes will be deployed.
answered Nov 25 at 1:56
Daniel Mikusa
5,2411813
5,2411813
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409078%2fhow-to-deploy-multi-module-maven-spring-boot-project-in-pivotal-cloud-foundry%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown