CRM and CX Blogs by Members
Find insights on SAP customer relationship management and customer experience products in blog posts from community members. Post your own perspective today!
cancel
Showing results for 
Search instead for 
Did you mean: 
R_Zieschang
Contributor
2,575
SAP Customer Checkout 2.0 FP13 was released recently with a bunch of new features for users and consultants. But also developers will see some changes within the ENV.jar to develop fantastic plugins for the product.

So what did change exactly?

The fat jar is dead


Prior to FP13 the ENV.jar was distributed as a "fat" JAR file, meaning all dependencies SAP Customer Checkout was using, were included in this JAR. This made development pretty easy as you could use these dependencies (e.g. Apaches Commons libraries) right away without worrying about the correct version to use.

You may have recognized the new folder "envLib" in your cco folder?


Furthermore the ENV.jar became much smaller than in previous releases!


ENV.jar FP12



ENV.jar FP13


Looking at these screenshots it may already dawn on you.

YES! The ENV.jar in FP13 does not have the dependencies included. This will lead, if not handled correctly by the developer to some confusions and strange behavior while runtime.

Imaging the situation, you want to use the Apache commons IO package in Version 2.8.1 because you encountered a bug in 2.8.0. You can include this dependency in your plugin via e.g. maven and on compile time everything looks fine.

You load up your CCO FP13 and realize your plugin is still affected by the bug in 2.8.0! Why?

Because CCO FP13 (see screenshot from the envLib folder) still uses 2.8.0 and because CCO will load before your plugin loads, your plugin will show unwanted behavior.

So how can we have the ENV.jar with all dependencies like we used to?

Dependency reduced pom.xml


With the release of FP13 SAP will provide a pom.xml which only holds information about the dependencies.


The dependency-reduced-pom.xml aka ENV.pom



Content of the ENV.pom


With the "thin" ENV.jar and the ENV.pom we can deploy this artifact in our local maven repository. The ENV.pom will include 3 packages, which are not in the public maven repositories, but we can deploy them with the same procedure.

So how do we do that?

Install the artifact


Open the command line tool of your choice. As I use macOs I will use iTerm2, on windows you can use CMD. To make this more convenient, I like to copy the jar and the pom files into one directory and navigate into this directory.


The source folder


Now we install the artifact (the jar + pom) to our local maven repository. The command is fairly easy.


Install the ENV.jar into your local maven repository



mvn install:install-file -DpomFile=ENV.pom -Dfile=ENV.jar

That's it! We can now go to our CCO plugin pom.xml and use the ENV.jar as dependency.


Added ENV.jar as dependency


But wait, there are still some errors?


Missing packages


So maven tries to retrieve all dependencies mentioned in the ENV.pom from public maven repositories, but as I already mentioned, some packages CCO uses, are not publicly available.

Therefore we install them like we installed the ENV.jar with one difference:

We do not have a pom xml for them, so we need to explicitly set the groupId, artifactId and version of the package. All of the three missing packages should be available in the envLib folder.


Missing packages


We need to determine the groupId, artifactId and version of this packages. ArtifactId is fairly easy. It is e.g. Likey. Version is also easy e.g. 1.0.0. But what is the groupId?

Open the ENV.pom and search for e.g. Likey.


Likey package


Now we have all necessary information available to install these missing packages into our local repository.


Installed Likey



mvn install:install-file -Dfile=Likey-1.0.0.jar -DgroupId=com.sap.security.core.server -DartifactId=Likey -Dversion=1.0.0 -Dpackaging=Jar

Now proceed with the two missing packages in the same way.
mvn install:install-file -Dfile=com.sap.js.passport.api-1.2.0.jar -DgroupId=com.sap.core.jdsr -DartifactId=com.sap.js.passport.api -Dversion=1.2.0 -Dpackaging=Jar
mvn install:install-file -Dfile=worm_api-5.5.4.jar -DgroupId=de.swissbit.tse -DartifactId=worm_api -Dversion=5.5.4 -Dpackaging=Jar

 

When we go back to our IDE and try to import the dependencies again, everything should run smoothly.


Sync successful


That is all. You are now able to develop like you used to prior FP13 and will have all packages available Customer Checkout is using.

If you have any further questions, please leave a comment. If you liked this short guide, feel free to like and share as it may help others.

 
12 Comments
Paulo_Pascoal
Explorer
0 Kudos

Hi Robert,

Thank you for the blog.

i need some help.

I think i followed your blog posts without missing anything and i was able to create some plugins for FP12 but now i need to do them for FP17.

So i stumble on this post and tried first with FP 13 version 2.13.14, to see if i can create something first.

I follow this and was all fine until I run the last 3 commands, after that i got diferent result, when i go back to eclipse and update my pom.xml it gives me 217 errors.



my declared dependency and some errors


 

Any idea what i did wrong? i tried this with FP17, but couldn't find the worm_api-5.5.4.jar and got the same result.

Do I need to still define the build path to the env.jar?
R_Zieschang
Contributor
0 Kudos
Hi paulopascoal,

 

did you try to clean your project in eclipse ( Project -> Clean)?
Yes in FP17 the worm api jar seems to be missing but it is also not mentioned in the env pom.xml.

What happens when you run "mvn clean package" from the command line in your /helloworld folder?

 

Regards
Robert
Paulo_Pascoal
Explorer
0 Kudos

Hi rzieschang

Yes I tried to clean project, but nothing changes.

When i run the "mvn clean package" i get this error:




Gives me an error on com.sap.core.jdsr:com.sap.js.passport.api, this almost looks like it's ignoring the one i have installed, so i tried the installation again:


But I got the same result has before when i try the mvn clean package.

R_Zieschang
Contributor
0 Kudos
So the maven build ignores the package because the retrieval failed to many times.

Can you run mvn clean package -U.

This forces maven to update all dependencies.
Paulo_Pascoal
Explorer
0 Kudos
I get this error:

R_Zieschang
Contributor
0 Kudos
Your maven still seems to search in the central maven repo rather than your local.

Try to force maven to act in offline mode with -o as Parameter when running mvn clean package. With this maven should use only the local repository.
Paulo_Pascoal
Explorer
0 Kudos


What i don't understand is why maven get the customercheckout from local repository and don't get the com.sap.js.passport.api.1.2.0

this looks fine to me

Paulo_Pascoal
Explorer
0 Kudos
I have done all steps again and only saw this now.

The error it's saying that the absent file is the "com.sap.core.jdsr:passport:pom:1.2.0" and in reality it's missing because the installation it's for the "com.sap.js.passport.api-1.2.0.jar", and when i run the command "mvn clean package" it tries to download the "passport-1.2.0.pom" from central and it's not able.

Maybe i am missing something, or maybe something change and maven it's not able to download it anymore??
Paulo_Pascoal
Explorer
0 Kudos

I am guessing that this happens because maven can't get the parent inside the com.sap.js.passport.api-1.2.0.pom.

Maybe something change and this don't work anymore, or was something I did wrong?

ricardo_renteria2
Participant
0 Kudos
Hi Paul,

did you get the solution? I'm facing the same situation. I hope you did and could share how to solve.
Paulo_Pascoal
Explorer
Hi,

I created one file called passport-1.2.0.pom at
.m2\repository\com\sap\core\jdsr\passport\1.2.0
with:
<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>
<groupId>com.sap.core.jdsr</groupId>
<artifactId>passport</artifactId>
<version>1.2.0</version>
<packaging>jar</packaging>
<name>Test</name>
<description>Test</description>
</project>

it's not the perfect solution, it still gives one error but i think i can ignore it, because all my plugins are working

 
PierreBrothier
Contributor
0 Kudos

Thank Paulo, this is a real time saver !

Labels in this area