Expand my Community achievements bar.

SOLVED

can you build and deploy core only?

Avatar

Level 9

currently, I am doing mvn clean install -PautoInstallSinglePackage after each change to a class in core.

 

Is there a more efficient way?  I can build core with 

 

cd core

mvn install

 

but presumably this does not deploy to running local server.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @TB3dock ,

 

When you hit the command "mvn clean install", maven will clean the target folder during the build and place the latest jar after creating it again. So basically, this will update the jar with the new codebase.

 

Other than that, if you want to install only the OSGi bundle in the AEM instance, you can use the below command.

"mvn clean install -PautoInstallBundle".

 

Here, "-PautoInstallBundle" will install only the OSGi bundle in the AEM instance.

 

You need to deploy the OSGI bundle every time any code changes have been made.

otherwise, you can use Mockito framework to test your code with some dummy data before deploying it into the AEM. This will save your time to do the deployment every time. For this approach, you can create a test case and use some sample data for that.

 

 

View solution in original post

2 Replies

Avatar

Community Advisor

Hi @TB3dock 

You can use the below command to deploy only core.

mvn clean install -PautoInstallBundle

Ensure you have the profile configured with autoInstallBundle in pom.xml

 

Thanks! 

Avatar

Correct answer by
Community Advisor

Hi @TB3dock ,

 

When you hit the command "mvn clean install", maven will clean the target folder during the build and place the latest jar after creating it again. So basically, this will update the jar with the new codebase.

 

Other than that, if you want to install only the OSGi bundle in the AEM instance, you can use the below command.

"mvn clean install -PautoInstallBundle".

 

Here, "-PautoInstallBundle" will install only the OSGi bundle in the AEM instance.

 

You need to deploy the OSGI bundle every time any code changes have been made.

otherwise, you can use Mockito framework to test your code with some dummy data before deploying it into the AEM. This will save your time to do the deployment every time. For this approach, you can create a test case and use some sample data for that.