Comments (3)
I think this is to do with how the in-place appRun
assembles the classpath and resource-path. For example, ./gradlew clean :web:appRunWar
works fine.
Also, if you run a build then cp lib/src/main/resources/hello.properties lib/build/classes/java/main/
, then :web:appRun
will also work.
I've seen this before in my projects and lamented that appRun
can't really assemble the war-like behaviour completely.
I'm curious about java-library
fixing it though - can you push another branch to your example project to demonstrate?
from gretty.
Here's the change on new branch: https://github.com/carey/gretty-resources/compare/java.
As I understand it, the java-library
plugin was made so that Java compilation would be much faster. It doesn't need to build against a jar for this, just build/classes
. But apparently it doesn't need the resources, either.
from gretty.
Thanks. For clarity, after execution of :web:appRun
using the java
plugin instead of java-library
, the following additional files are present:
diff java-library.txt java.txt
16a17,21
> lib/build/resources
> lib/build/resources/main
> lib/build/resources/main/hello.properties
> lib/build/libs
> lib/build/libs/lib.jar
17a23,24
> lib/build/tmp/jar
> lib/build/tmp/jar/MANIFEST.MF
So java
is both building the jar
and copying the resources file into the build tree. As already observed, running :lib:jar
results in the same files as above, and everything works fine.
I think this was partially anticipated by the Gradle team according to https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_known_issues_compat . So I think what we could do here is try and link in with java-library
and effectively force the dependency on :lib:jar
so that you don't have to run it explicitly. How does that sound?
I'm not sure there are other good options based on what the standard lifecycle of java-library
is doing (or not doing) with resources, but someone else might have a suggestion.
Of course pull-requests for this are welcome :).
from gretty.
Related Issues (20)
- Not able to run the app using Gretty 4.0.3 in combination with JDK17 and Gradle 7.5.1. HOT 2
- Wrong warning about missing slf4j provider HOT 1
- Gretty 3.0.8+ is incompatible with Proguard `7.3.0` HOT 4
- Cannot inject Tomcat DBCP 2 library in Gretty 3.1.0 via dependencies/gretty HOT 4
- Gretty always configures the `war` task
- Some logger properties missing when upgrading from 3.0.6 to 3.1.1 HOT 6
- Update Documentation on Gretty Logging
- No such property: CONTAINER_JAR_PATTERN for class: org.eclipse.jetty.webapp.MetaInfConfiguration HOT 4
- Gradle 8 deprecation warnings
- Exception occurs when using Gretty and Thymeleaf Layout Dialect together. HOT 1
- 4.0.3 -> 4.1.0 HOT 1
- Errors seem to leave gretty/jetty running without the ability to shutdown without killing processes manually HOT 3
- Upgrading to 4.0.1 and now getting CONTAINER_JAR_PATTERN error HOT 1
- JettyRestart task fails with MissingMethodException: No signature of method: org.akhikhl.gretty.JettyServerManager.startServer HOT 6
- ExtraResourceBase not found after updating from 3.x to 4.x
- Remove usage of deprecated `org.gradle.util.VersionNumber` HOT 1
- Gretty 4.1.1 requires the `src/main/webapp` path.
- jettyStart throws exception if using jetty-env.xml
- Crash when trying to run a product built with buildProduct HOT 3
- CVE-2024-30172 in bouncycastle 1.77
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gretty.