“setup of YC in STS IDE”?

39 views
Skip to first unread message

Archana Verma

unread,
Sep 6, 2017, 5:04:24 AM9/6/17
to YesCart - pure eCommerce, platform with open source
Good Morning to Yes-Cart Community,
Today I have Configured Yes-Cart project in My System IDE(i.e. STS{Spring-tool suite}),where I did the following things that are:

1)resolve error in all modules corresponding ‘pom.xml’ & another related file. After that install maven & makes build success of all existing module present in yes-cart project.[Success]

2)In Our second Step we change the database from ‘HSql ’ to ‘MySql’->for which we makes changes in these file regarding all module.

a)makes changes in ‘persistence.xml’ i.e.
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/yeskart"/>
<property name="username" value="root"/>
<property name="password" value=""/>

And
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>

b)add mySql dependency in modules-corresponding pom.xml file.

c)do level=”ON” in ‘logback-test.xml’ file.

After following above 3 step our database goanna created with empty data in all the tables.[processing wd issue of empty data].

3) After database configuration, when we are going to install-maven for different module its build goanna fail[resolve in some module]

And when I’m going to run Yes-Cart ‘Admin-module’ that is [jam] its build goanna fail because,

[WARNING] The POM for org.yes:jam-services:jar:3.4.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

a) so we go to jam-services module, and installing maven, here we get the issue that is:
Results :

Tests in error:
testGetAll(org.yes.cart.service.vo.impl.VoCategoryServiceImplTest): Configuration problem: Failed to import bean definitions from URL location [classpath:core-dto-services.xml]
testUpdateVoShopLocale(org.yes.cart.service.vo.impl.VoShopServiceDerivedImplTest): Configuration problem: Failed to import bean definitions from URL location [classpath:core-dto-services.xml]
testUpdateCurrency(org.yes.cart.service.vo.impl.VoShopServiceDerivedImplTest): Configuration problem: Failed to import bean definitions from URL location [classpath:core-dto-services.xml]
testUpdateUrls(org.yes.cart.service.vo.impl.VoShopServiceDerivedImplTest): Configuration problem: Failed to import bean definitions from URL location [classpath:core-dto-services.xml]

Tests run: 9, Failures: 0, Errors: 4, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Yes Cart

unread,
Sep 6, 2017, 7:14:37 AM9/6/17
to YesCart - pure eCommerce, platform with open source
Hi,

The subject of your question is a bit misleading as you are asking about changing the ‘HSql ’ to ‘MySql’ which does not depend on IDE you use (For IDE it does not matter what database you connect to).

Your step 2 is redundant and in fact you broke the project by doing your changes that is why it does not build.

To build YC with MySQL support all you need is to use profiles, so when you do maven build to deploy under Tomcat with connection to MySQL you need to build:

mvn install -Pdev,mysql,paymentAll

Then you end up with war file including correct connection and MySQL driver dependencies. The connection can be specified in the env/maven/dev/config-db-mysql.properties It works because we specified the "dev" profile which makes it look in env/maven/dev and then "mysql" profile which uses the config-db-mysql.properties for connection settings.

And that is it.

You were changing all persistence.xml (I assume in tests also). So not only you broke the mechanism above, but you also broke the tests. Tests ALWAYS connect to Derby in-memory database and load test data. Because you changed the connection you end up with test connecting to your blank MySQL DB and fail (obviously because there is no data)

So you need to revert all your changes and use maven profiles "-P" parameter. 

Before you start your YC on Tomcat with MySQL you need to prepare database which is written here http://www.inspire-software.com/confluence/display/YC3J/MySQL+quick+start

There is also a video of the full process of preparing your environment in Intellij IDEA https://www.youtube.com/watch?v=Ucd-2XfGWfg&list=PLFXlcPhFRUJohe13g5v7oKvUC4O4oogE5&index=1
I understand that you have different IDE but the general approach should be the same, which is setup your IDE to use maven profiles.
Have a look at the http://www.inspire-software.com/confluence/display/YC3J/From+source to give you some more background on how maven build works

So just to reiterate:
- revert your changes
- work out how to setup maven profiles in your IDE

Regards,
YC team
Reply all
Reply to author
Forward
0 new messages