Foren

blade deploy vs gradle deploy

thumbnail
Jack Bakker, geändert vor 7 Jahren.

blade deploy vs gradle deploy

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
in Liferay 7 GA3

in command line (I am on linux), after cd to ../modules/apps/contactform-web

the following command deploys fine:

blade deploy build/libs/ca.domain.server.contactform.web-1.0.0.jar

the following command builds fine:

../../../gradlew build

yet the following does not copy the jar into the Liferay 'deploy' folder

../../../gradlew deploy

what might I be missing ? I am hoping to use gradle tasks in IntelliJ and while I see the 'deploy' task, like with the command line it doesn't end up deploying.
gordon daniels, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Master Beiträge: 797 Beitrittsdatum: 24.08.08 Neueste Beiträge
You actually expected it to deploy emoticon

Hiya Jack. Hope all is well with you. How do you like 7.0?
thumbnail
Jack Bakker, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
gordon daniels:
You actually expected it to deploy emoticon

I have functional ways forward and as I gain an initial learning of gradle and blade, I look to make my dev enviro and dev iterations more efficient.
gordon daniels:

Hiya Jack. Hope all is well with you. How do you like 7.0?

Are you hijacking this thread emoticon
I'm starting to recognize the benefits of v7 features and approaches. I've gone through theme and layout development exercises and then a content/theme creation phase and really like most of the new v7 WCM features and gulp watch is a new friend. I've also started simple portlets and servicebuilder projects, and am digging OSGi. All in good time I hope.
Enjoy Gordon
gordon daniels, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Master Beiträge: 797 Beitrittsdatum: 24.08.08 Neueste Beiträge
I should have announced this was a hijack! Actually, I've had the same issue but was waiting on searches to turn up an answer. Glad to hear you like the new stuff. Good luck.
thumbnail
Jamie Sammons, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Expert Beiträge: 297 Beitrittsdatum: 05.09.14 Neueste Beiträge
Hi Jack,

When you run gradlew deploy it puts the module in <workspace_dir>/bundles/osgi/modules directory by default. You can configure Liferay Workspace to use another bundle by editing the gradle.properties file in the root of the workspace and setting liferay.workspace.home.dir= to where your bundle is. Then when you run gradlew deploy it should put it in your bundle under osgi/modules.

Hope this helps!
-Jamie
thumbnail
Jack Bakker, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
Hi Jamie
Jamie Sammons:

When you run gradlew deploy it puts the module in <workspace_dir>/bundles/osgi/modules directory by default.

Thanks and yes, this indeed does happen. However, after such I don't see any changes I might have made, say to a view.jsp. If I do the blade deploy approach, or copy the .jar into the Liferay deploy folder, then I do see the changes. I must be missing something obvious to OSGi savvy folks out there.
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste Beiträge
You cannot rely on hot deploy w/ osgi, it tends to keep old references around that mask your updates.

After a deploy, first step is to restart the container. If you still believe your changes are not taking effect, shut down the server and purge the contents of the osgi/state directory and try again.
thumbnail
Jack Bakker, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
Good thing I don't mind sounding like a nube as I explore this. It's a matter of mind over matter. If you don't mind, it doesn't matter.

I am gathering there is additional 'magic' going on when one uses blade deploy, and also when dropping in the portal property path specified by "auto.deploy.deploy.dir". Plz correct me if I am off track or outright mistaken, but I see blade also stops and starts the module.

I tried the gradle deploy, and then with gogo stop and start it, but given my test jsp updates still not visible via browser, there must be more going on with a gradle deploy or dropping it in the auto.deploy.deploy.dir. (plz, go ahead and laugh all those of you magicians who have been working on this for many years...).

I guess I am used to a maven-like liferay:deploy task that I can use via command line, or via IntelliJ IDEA.
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste Beiträge
JSP fragment bundle or a JSP-based portlet that isn't updating?

JSPs from bundles end up compiled into the $LIFERAY_HOME/work directory, if you have a stale JSP you might consider whacking the contents of this directory and starting the server to get fresh JSP compiles.

I've never used the blade deploy so I don't know what's going on w/ that one.

The gradle deploy option sticks within your liferay workspace to handle the deploy into your local bundle. When the modules get deployed they go directly to the osgi/modules directory (skipping the whole deploy folder push).
thumbnail
Jack Bakker, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
David H Nebinger:
JSP fragment bundle or a JSP-based portlet that isn't updating?

portlet
David H Nebinger:

JSPs from bundles end up compiled into the $LIFERAY_HOME/work directory, if you have a stale JSP you might consider whacking the contents of this directory and starting the server to get fresh JSP compiles.

done the delete of contents in tomcat*/work and tomcat*/temp , didn't allow gradle deploy to hot deploy
David H Nebinger:

I've never used the blade deploy so I don't know what's going on w/ that one.

You should try it, it works well emoticon
David H Nebinger:

The gradle deploy option sticks within your liferay workspace to handle the deploy into your local bundle. When the modules get deployed they go directly to the osgi/modules directory (skipping the whole deploy folder push).

Yeah, as Jamie was also writing.

Ok, so from what I think I'm reading in this thread, a '../../../gradlew deploy' from within a ../modules/apps/myapp is supposed to hot deploy. Hmmm... wonder what's up in my approach/enviro then.
thumbnail
Jack Bakker, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
btw David (a.k.a. user.26526), in your blog "Liferay 7 Development, Part 5" you give instructions to build with:

../../../gradlew build

yet give a step to deploy with a move of jar to deploy folder
user.26526:

You should end up with your new com.liferay.filesystem.access.web-1.0.0.jar bundle file in the build/libs directory. If you have a Liferay 7 CE or Liferay DXP tomcat environment running, you can drop the jar into the Liferay deploy folder.
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste Beiträge
Jack Bakker:
btw David (a.k.a. user.26526), in your blog "Liferay 7 Development, Part 5" you give instructions to build with:

../../../gradlew build

yet give a step to deploy with a move of jar to deploy folder
user.26526:

You should end up with your new com.liferay.filesystem.access.web-1.0.0.jar bundle file in the build/libs directory. If you have a Liferay 7 CE or Liferay DXP tomcat environment running, you can drop the jar into the Liferay deploy folder.


This is my personal thing, I always simulate what is going to take place in test and other higher environments where "gradlew deploy" is not going to be an option. I prefer knowing what is going to happen when I get to those upper environs earlier in the dev cycle rather than later. It is totally my personal development pattern that I let slip into the blog posting...
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste Beiträge
Jack Bakker:
David H Nebinger:

JSPs from bundles end up compiled into the $LIFERAY_HOME/work directory, if you have a stale JSP you might consider whacking the contents of this directory and starting the server to get fresh JSP compiles.

done the delete of contents in tomcat*/work and tomcat*/temp , didn't allow gradle deploy to hot deploy


JSPs from modules end up in $LIFERAY_HOME/work, not tomcat*/work.

Ok, so from what I think I'm reading in this thread, a '../../../gradlew deploy' from within a ../modules/apps/myapp is supposed to hot deploy. Hmmm... wonder what's up in my approach/enviro then.


Hot deploy is not supported for modules. OSGi tends to keep stale references to older versions, etc. After a deployment, a restart is recommended especially if you see oddball things like this.
thumbnail
Jack Bakker, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
David H Nebinger:

JSPs from modules end up in $LIFERAY_HOME/work, not tomcat*/work.

good to know, thanks
David H Nebinger:

Hot deploy is not supported for modules. OSGi tends to keep stale references to older versions, etc. After a deployment, a restart is recommended especially if you see oddball things like this.

But... blade deploy or dropping jar in deploy folder does hot deploy ? yet just a gradle deploy doesn't ? I think we are back to the point of my post in the first place.
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste Beiträge
Hot deploy is any deploy you do while Liferay is running w/o a restart.
thumbnail
Jack Bakker, geändert vor 7 Jahren.

RE: blade deploy vs gradle deploy

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
for now, I added a gradle task called hotDeploy which depends on build and copies the jar to the portal deploy folder

task hotDeploy(type: Copy){
    dependsOn build
    from(file('build/libs/ca.domain.server.contactform.web-1.0.0.jar'))
    into('/home/jbakker/lr7/client70ce/liferay-ce-portal-7.0-ga3/deploy')
}