Foren

Order of module's starting

Csaba Meszaros, geändert vor 7 Jahren.

Order of module's starting

Junior Member Beiträge: 42 Beitrittsdatum: 10.10.13 Neueste Beiträge
I have a fragment module, and a resource module, which provides the fragment with additional strings. It would work normally but I have a serious problem: the fragment starts after the resource module, so the keys in the resource module are not recognized on fragment's JSPs.
The only solution is to restart the resource module with Gogo shell after the server is started.
Since I am working on a project with nearly 100 modules already, I really need to address this behavior.

My question is: how could I force the resource module to start after all other modules did start?

Thanks!
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: Order of module's starting

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
See my blog post https://web.liferay.com/web/user.26526/blog/-/blogs/adding-dependencies-to-jsp-fragment-bundles

If you have a dependency declared, the fragment will not start until the dependency is satisfied.
Csaba Meszaros, geändert vor 7 Jahren.

RE: Order of module's starting

Junior Member Beiträge: 42 Beitrittsdatum: 10.10.13 Neueste Beiträge
Hi! It nearly works...
Nearly, because your example is a service, while my is a Resourcebundle loader module. I cannot add the dependency gradle would accept:
my module for that is minthaka.registration.resource. How can I add it to fragment's build.gradle file, because this doesn't work:

dependencies {
compile group: "minthaka.registration.resource", name: "minthaka.registration.resource", version: "1.0.0"
}

It simply fails to compile.
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: Order of module's starting

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
If it's part of the gradle workspace you should be using the project form:

    compile project(":modules:resource-bndl")
Csaba Meszaros, geändert vor 7 Jahren.

RE: Order of module's starting

Junior Member Beiträge: 42 Beitrittsdatum: 10.10.13 Neueste Beiträge
Dont't take it as offence but that style of answers doesn't help me at all. I would really appreciate something more clear:
I have fragment minthaka.registration.fragment and bundle minthaka.registration.resource. These are two separate modules inside the Liferay workspace. I intend to use the latter to provide me extra strings and it does, but only if I restart this using Gogo shell.
So where do I have to implement this

dependencies {
compile project(":modules:resource-bndl")
}
part?

This :something:otherThing is not very understable.
Csaba Meszaros, geändert vor 7 Jahren.

RE: Order of module's starting

Junior Member Beiträge: 42 Beitrittsdatum: 10.10.13 Neueste Beiträge
dependencies {
compile project(":modules:minthaka.registration.resource")
}

in fragment's build.gradle compiles, but the strings remain unrecognized, and the fragment happily did start without the resource module.