cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data hub deployment steps

Former Member
0 Likes
1,302

Hi Experts,

I am new to data hub and want to understand what is the proper way to deploy extensions. I am importing data from csv file to hybris 6.8

From what I understand, we do following steps:

1) We create mvn project by running mvn install:install-file command

2) Change extension xml, java source file and spring file as per requirement

3) mvn clean install

4) create jar files for raw, canonical and target extensions using jar -cf

5) manually copy the jar files from target folder and resource folder and paste it inside /opt/datahub/extensions

6) start tomcat

I want to understand following thing:

1) Are my steps correct or is there a better way to perform any of the mentioned step specially 5th step?

2) Is it better to create different maven product for different items? For example: different projects for Product, category, price, etc.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member473180
Participant
0 Likes

data hub is dead move on integration objects and create your own CSV to OData client. If you are going to use Data Hub (do the overlay maven build as a web app)

Slava
Product and Topic Expert
Product and Topic Expert
0 Likes

Attempted to provide a comment for Marcus's answer but it did not work, so I'm placing it here. The overall idea laid out in you question is correct but the specific steps are strange:

Step 1) mvn install:install-file adds a jar file to your local maven repo, typically located in $HOME/.m2/repository - it does not st new project. You need this command only to make the sdk and the archetype jars know to maven. The best way to st new project is to generate it from the maven artifact as it's described in https://help.hybris.com/1808/hcd/8ec7f04215344470af8851f271e84d29.html. Run that mvn archetype:generate command and make sure to use exact version from the install:install-file for the artifact and the sdk version, e.g.:

 mvn archetype:generate -DarchetypeGroupId=com.hybris.datahub -DarchetypeArtifactId=datahub-extension-archetype -DarchetypeVersion=18.08.0-RC5 -DgroupId=test.datahub.ext -DartifactId=my-ext -DsdkVersion=18.08.0-RC5

It will prompt you for a couple of values and then generate the project in my-ext directory that you can import to IDE as a maven project. After that follow Markus's advice to make it simpler running/testing/debugging during development.

Step 4) No need to use jar -cf - mvn install executed from the my-ext directory creates the jar files in the target subfolders of the canonical. raw, and target modules inside the my-ext folder. It also places those jars to your local maven repo, so that they can be referenced by other maven projects. If you don't need to put them into the maven repo but simply need jar files: mvn package is sufficient. mvn clean simply deletes everything in the target directories to guarantee a clean build.

Step 5) that's correct but is needed only, if you're running a stand-alone Tomcat and want to test your extension with it. Otherwise, if you follow the Markus's answer you'll be able to start tomcat right in your IDE.

Hope this clarifies Markus's answer and helps you. You may need to learn a bit more about maven and its war overlays to understand what exactly is happening.

mpern
Product and Topic Expert
Product and Topic Expert
0 Likes
  1. setup your datahub project as war overlay

  2. You can now build the datahub with all extensions "baked in"

  3. you only need to deploy the new war

EDIT 2018-12-07

You stated as comment that you are "exploring how to import data as csv"

For that, the datahub is overkill (and also a dead end), a simple solution would be Hotfolder Imports, for which you can also find examples in the platform.

If you want to go for something more fancy and future proof, go for the new OData API, as already pointed out

Former Member
0 Likes

I have done the first point you have mentioned. I did not get what you are trying to convey in 2nd and 3rd point. A detailed information would to great as I am new to Data Hub and Hybris.

mpern
Product and Topic Expert
Product and Topic Expert
0 Likes

Do you have experience in java programming & maven? Do you know what a WAR file is?