掲示板

Where should custom sql go in a maven build?

12年前 に Marcus Svensson によって更新されました。

Where should custom sql go in a maven build?

New Member 投稿: 1 参加年月日: 12/03/07 最新の投稿
Hi

I'm wondering if anyone have used custom sql when using build-service in a maven build?

When using ant the custom-sql/default.xml should go under /src/, but I haven't been able to find where to put it when using maven.
I've tried moving the folder around in most folders with no luck. So any tips on how to achieve this would be apprecieated.

Thanks!
10年前 に Michael Rohleder によって更新されました。

RE: Where should custom sql go in a maven build?

New Member 投稿: 19 参加年月日: 13/07/31 最新の投稿
put it in the service-impl folder in src/main/webapp/custom-sql/default.xml so that maven packages it under /
I just came to this issue and after putting it there CustomSQLUtil.get() was able to find it.
thumbnail
8年前 に Shalinee Tawar によって更新されました。

RE: Where should custom sql go in a maven build?

New Member 投稿: 5 参加年月日: 15/02/06 最新の投稿
For maven build we have to put custom-sql folder in project/src/main/resources/custom-sql folder. Which will create custom-sql folder in classes folder of project in tomcat at runtime.
thumbnail
7年前 に Raja M によって更新されました。

RE: Where should custom sql go in a maven build?

New Member 投稿: 3 参加年月日: 17/02/17 最新の投稿
Michael Rohleder:
put it in the service-impl folder in src/main/webapp/custom-sql/default.xml so that maven packages it under /
I just came to this issue and after putting it there CustomSQLUtil.get() was able to find it.

This is not correct way of doing it,it should be under src/main/resources/custom-sql/default.xml because custom-sql/default.xml will come under web-inf/classes folder of project
thumbnail
8年前 に Rahul Panchivala によって更新されました。

RE: Where should custom sql go in a maven build?

New Member 投稿: 14 参加年月日: 15/01/21 最新の投稿
hi marcus,

It should be in src\main\resources\resource-actions
thumbnail
8年前 に Andrew Jardine によって更新されました。

RE: Where should custom sql go in a maven build?

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
Rahul,

You should not put custom sql definitions in the resource-actions folder. The best practice is, as was previously suggested, to put them in a custom-sql folder. Putting them in the resource-actions would be confusing as people typically look in there for resource permissions, not custom sql.

The answer to the original question boils down to ... all resource files (properties, xml configs, etc) in maven projects should go in teh resources project folder.
thumbnail
8年前 に Rahul Panchivala によって更新されました。

RE: Where should custom sql go in a maven build?

New Member 投稿: 14 参加年月日: 15/01/21 最新の投稿
Hi Andrew,

Thanks for correcting me...
thumbnail
8年前 に Andrew Jardine によって更新されました。

RE: Where should custom sql go in a maven build?

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
No problem. As I said, you can technically put them anywhere but, I personally recommend, it is best to just have a look at the Liferay source code and follow their pattern. If nothing else, it makes it really easy to move between your own source code and Liferay's.