Fórum

Where should custom sql go in a maven build?

Marcus Svensson, modificado 12 Anos atrás.

Where should custom sql go in a maven build?

New Member Mensagem: 1 Data de Entrada: 07/03/12 Postagens Recentes
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!
Michael Rohleder, modificado 10 Anos atrás.

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

New Member Postagens: 19 Data de Entrada: 31/07/13 Postagens Recentes
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
Shalinee Tawar, modificado 8 Anos atrás.

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

New Member Postagens: 5 Data de Entrada: 06/02/15 Postagens Recentes
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
Raja M, modificado 7 Anos atrás.

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

New Member Postagens: 3 Data de Entrada: 17/02/17 Postagens Recentes
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
Rahul Panchivala, modificado 8 Anos atrás.

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

New Member Postagens: 14 Data de Entrada: 21/01/15 Postagens Recentes
hi marcus,

It should be in src\main\resources\resource-actions
thumbnail
Andrew Jardine, modificado 8 Anos atrás.

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

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
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
Rahul Panchivala, modificado 8 Anos atrás.

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

New Member Postagens: 14 Data de Entrada: 21/01/15 Postagens Recentes
Hi Andrew,

Thanks for correcting me...
thumbnail
Andrew Jardine, modificado 8 Anos atrás.

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

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
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.