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

Asset changes in subprojects #12484

Closed
n4cer opened this issue Mar 19, 2024 · 7 comments
Closed

Asset changes in subprojects #12484

n4cer opened this issue Mar 19, 2024 · 7 comments
Milestone

Comments

@n4cer
Copy link

n4cer commented Mar 19, 2024

Play Version

3.0.2

API

Java

Operating System

Windows 10
behavior on other OSes is unknown

JDK

openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7-Ubuntu-122.04.1)
OpenJDK 64-Bit Server VM (build 17.0.10+7-Ubuntu-122.04.1, mixed mode, sharing)

Library Dependencies

Expected Behavior

  1. run project with subprojects in dev mode and open it
  2. assets are located in a subproject
  3. change an asset like a javascript file or something
  4. reload the page and the asset is updated

Actual Behavior

  1. a change to an asset is never updated until the project is cleaned

Reproducible Test Case

https://github.com/n4cer/playSubprojects_3-0

Description

We have divided a project into 3 subprojects: "common, website, and admin".
Our assets are located in the common module.

Since play 2.9/3.0, we have encountered an issue where changes to these assets are no longer detected in dev mode.
Without "clean", the changes are not applied. If we move the assets to the root project, dev mode works as expected again. However, this results in the assets being missing from the dist packages of admin and website.

@rhs77
Copy link

rhs77 commented Apr 29, 2024

Hallo,

Any news about a fix?

greetings

Rami

@mkurz
Copy link
Member

mkurz commented Apr 29, 2024

Hallo,

working on it in

@mkurz
Copy link
Member

mkurz commented Jun 5, 2024

@mkurz
Copy link
Member

mkurz commented Jun 7, 2024

I found the cause and a fix is underway:

@mkurz
Copy link
Member

mkurz commented Jun 8, 2024

Until the next Play patch release is out you can fix this by upgrading to latest webjars-locator-core, just put in your project/plugins.sbt:

// Can be removed when Play 2.9.4/3.0.4 is released
libraryDependencies += "org.webjars" % "webjars-locator-core" % "0.59"

Let me now if this works for you.
(btw, the version of the sub-project during developing in dev mode should end with -SNAPSHOT, otherwise this fix is not working. But I think this is quite common anyway)

mkurz added a commit to mkurz/playframework that referenced this issue Jun 10, 2024
mkurz added a commit to mkurz/playframework that referenced this issue Jun 10, 2024
@mkurz mkurz closed this as completed in 6b295a3 Jun 10, 2024
mergify bot pushed a commit that referenced this issue Jun 10, 2024
mergify bot pushed a commit that referenced this issue Jun 10, 2024
Contains webjars/webjars-locator-core#159
to fix #12484

(cherry picked from commit 6b295a3)

# Conflicts:
#	project/Dependencies.scala
mkurz added a commit that referenced this issue Jun 10, 2024
Contains webjars/webjars-locator-core#159
to fix #12484

(cherry picked from commit 6b295a3)

# Conflicts:
#	project/Dependencies.scala
mkurz added a commit that referenced this issue Jun 10, 2024
Contains webjars/webjars-locator-core#159
to fix #12484

(cherry picked from commit 6b295a3)

# Conflicts:
#	project/Dependencies.scala
@n4cer
Copy link
Author

n4cer commented Jun 14, 2024

Works for us!
Thank you!

@mkurz
Copy link
Member

mkurz commented Jun 14, 2024

Great! This will work in next Play's patch release out of the box.

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

No branches or pull requests

3 participants