Foros de discusión

Where should custom sql go in a maven build?

Marcus Svensson, modificado hace 12 años.

Where should custom sql go in a maven build?

New Member Mensaje: 1 Fecha de incorporación: 7/03/12 Mensajes recientes
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 hace 10 años.

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

New Member Mensajes: 19 Fecha de incorporación: 31/07/13 Mensajes recientes
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 hace 8 años.

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

New Member Mensajes: 5 Fecha de incorporación: 6/02/15 Mensajes recientes
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 hace 7 años.

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

New Member Mensajes: 3 Fecha de incorporación: 17/02/17 Mensajes recientes
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 hace 8 años.

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

New Member Mensajes: 14 Fecha de incorporación: 21/01/15 Mensajes recientes
hi marcus,

It should be in src\main\resources\resource-actions
thumbnail
Andrew Jardine, modificado hace 8 años.

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

Liferay Legend Mensajes: 2416 Fecha de incorporación: 22/12/10 Mensajes recientes
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 hace 8 años.

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

New Member Mensajes: 14 Fecha de incorporación: 21/01/15 Mensajes recientes
Hi Andrew,

Thanks for correcting me...
thumbnail
Andrew Jardine, modificado hace 8 años.

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

Liferay Legend Mensajes: 2416 Fecha de incorporación: 22/12/10 Mensajes recientes
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.