maven-hpi-plugin icon indicating copy to clipboard operation
maven-hpi-plugin copied to clipboard

Reload scripts

Open KostyaSha opened this issue 8 years ago • 13 comments

https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/jenkins/model/Jenkins.java#L4832

Seems groovy reload doesn't work without it.


This change is Reviewable

KostyaSha avatar Oct 04 '16 01:10 KostyaSha

cc ~~findbugsman~~ @oleg-nenashev

KostyaSha avatar Oct 04 '16 01:10 KostyaSha

You forgot to use a permalink (Y button in GitHub).

jglick avatar Oct 31 '16 12:10 jglick

Sounds like it would solve the issue (whatever that is exactly). This will have effect on more than just that, though. For example, people trying to test the effect of using resURL will no longer be able to. I think it is not a big deal.

jglick avatar Oct 31 '16 12:10 jglick

Seems groovy reload doesn't work without it.

But i not sure, sometimes resources doesn't reload after changes at all...

KostyaSha avatar Oct 31 '16 12:10 KostyaSha

Rather than completely turning off caching, which makes interacting with Jenkins in hpi:run mode painfully slow, I would like to see Jenkins actually check file timestamps and invalidate its cache intelligently.

jglick avatar Dec 16 '16 13:12 jglick

Even with this arg changed groovy scripts i.e. in config-detail.groovy in OptionalJobProperty doesn't reload. They reload while there is error and then somewhere cached.

@jglick do you have any idea what else to check?

KostyaSha avatar Dec 27 '16 19:12 KostyaSha

Just to respond to the ping in Skype from @KostyaSha. I ignore mentions which I find insulting.

oleg-nenashev avatar Dec 27 '16 19:12 oleg-nenashev

So, https://github.com/stapler/stapler/blob/7065a603a6dde83f015bd8d600e1692673d37edb/groovy/src/main/java/org/kohsuke/stapler/jelly/groovy/GroovierJellyScript.java#L41-L50 Loads groovy file from target/classes/$class/some.groovy when it available. When i delete it, it picks groovy file from src/main/resources as expected.

KostyaSha avatar Dec 27 '16 20:12 KostyaSha

Then https://github.com/stapler/stapler/blob/7065a603a6dde83f015bd8d600e1692673d37edb/core/src/main/java/org/kohsuke/stapler/lang/KlassNavigator.java#L154 returns groovy from target even if URLClassLoader contains src/main/resources first in list.

KostyaSha avatar Dec 27 '16 21:12 KostyaSha

Maybe IDEA messing classloaders?

KostyaSha avatar Dec 27 '16 21:12 KostyaSha

returns groovy from target even if URLClassLoader contains src/main/resources first in list

Sounds like it may be a bug in Stapler. Note that the order would not matter if your IDE automatically copies files from src/main/resources/ to target/classes/ after modification, as I think NetBeans at least does.

Best to check behavior first without an IDE (using mvn compile to test propagation of changes).

jglick avatar Jan 06 '17 15:01 jglick

if your IDE automatically copies files from src/main/resources/ to target/classes/ after modification

Is it default NetBeans behaviour or you jenkins-plugin?

KostyaSha avatar Jan 06 '17 15:01 KostyaSha

Default behavior.

jglick avatar Sep 26 '17 15:09 jglick