Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlays for repository based web apps in a farm #4

Open
joankaradimov opened this issue Mar 31, 2016 · 9 comments
Open

Overlays for repository based web apps in a farm #4

joankaradimov opened this issue Mar 31, 2016 · 9 comments
Assignees
Milestone

Comments

@joankaradimov
Copy link

Hello,
Thanks for the effort of supporting this.

I'm having a problem. I want to have an overlay for a webapp in a farm. But the webapp does not come from a subproject. It is a maven artifact. I initially tried something like:

farm {
    webapp 'some-group-id:some-artifact-id:1.2.3', overlay: ':some-project'
}

According to the documentation (here) you can pass web-app-specific properties as named arguments (like this). The list of properties (here) lists overlays as a property. However, this is a method and can not be used in the context of the code snippet above.

I am continuing to read the code of gretty and trying to find a work-around. But it would be great if you have some input on this.

@saladinkzn
Copy link
Owner

Hey

From fast lookup in gretty source I found out that overlays cannot be used
in the way you want to because overlays are detected in
afterProjectEvaluate by detecting overlays field on gretty extension (not
webconfig-level property). So there's not workaround to make it work in
current implementation for war file or maven dependency.

But it can be supported with some coding so I'll try to do my best and
provide this feature in 1.2.6 release.

2016-03-31 14:24 GMT+03:00 Joan Karadimov [email protected]:

Hello,
Thanks for the effort of supporting this.

I'm having a problem. I want to have an overlay for a webapp in a farm.
But the webapp does not come from a subproject. It is a maven artifact. I
initially tried something like:

farm {
webapp 'some-group-id:some-artifact-id:1.2.3', overlay: ':some-project'
}

According to the documentation (here
http://akhikhl.github.io/gretty-doc/Farm-web-app-list.html#_repository_based_web_app_references)
you can pass web-app-specific properties as named arguments (like this
http://akhikhl.github.io/gretty-doc/Farms-and-web-app-specific-properties.html#_web_app_specific_properties_override).
The list of properties (here
http://akhikhl.github.io/gretty-doc/Gretty-configuration.html#_web_app_specific_properties)
lists overlays as a property. However, this is a method and can not be
used in the context of the code snippet above.

I am continuing to read the code of gretty and trying to find a
work-around. But it would be great if you have some input on this.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#4

@joankaradimov
Copy link
Author

If you have the time to give me some guidelines, I could try to implement that.

@saladinkzn
Copy link
Owner

I think the easiest way to achieve that is to write a task which explodes war dependency to some temp folder, apply overlays over it and then repackage war archive to some destination.

I would recommend you to create additional property in GrettyExtension named like overlayWars so you can configure it like

gretty {
overlayWar 'some-group-id:some-artifact-id:1.2.3', overlays: [ project(':someProjects')]
}

Then in org.akhikhl.gretty.GrettyPlugin#addTasks you should check for it and add a task for each detected war. This task should:

  1. Download your war from repository (or if it's a local file, skip this step)
  2. explode your war
  3. apply overlays over it
  4. repackage war to some destination

Then in org.akhikhl.gretty.GrettyPlugin#addTaskDependencies you should check if webApp in your farm is overlayed. If so you should add task dependency for farmStartTask to task you create.

You can use 'explodeWebApps' and 'overlayArchive' as a base line (note that they process war created by war task).

@joankaradimov
Copy link
Author

Hey, I'm experiencing some difficulties with this. Should I leave it to you or are you too busy for it?

@saladinkzn
Copy link
Owner

I'm thinking about a right way to implement this properly so you can leave
it to me :)

2016-04-12 16:37 GMT+03:00 Joan Karadimov [email protected]:

Hey, I'm experiencing some difficulties with this. Should I leave it to
you or are you too busy for it?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#4 (comment)

@joankaradimov
Copy link
Author

Ok, thanks!

@boris-petrov
Copy link

Hello, is there any progress on this?

@saladinkzn saladinkzn self-assigned this May 26, 2016
@saladinkzn saladinkzn added this to the 1.2.6 milestone May 26, 2016
saladinkzn added a commit that referenced this issue May 29, 2016
saladinkzn added a commit that referenced this issue May 29, 2016
@saladinkzn
Copy link
Owner

I've implemented this feature in 1.2.6-SNAPSHOT. Can you please test it in ur use cases?

@joankaradimov
Copy link
Author

Thanks!

Sorry, about the delay. Some other higher priority stuff came out. I'll test it in the next day or two and write about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants