maven-hpi-plugin
maven-hpi-plugin copied to clipboard
Handle presence of index.jelly differently
Signed-off-by: Thierry Wasylczenko [email protected]
Currently if there is no src/main/resources/index.jelly
file in the Jenkins plugin sources, mvn hpi:run
will fail the build indicating the file must be created using the POM's <description>
. This behaviour has been introduced in #302. As I like to enforce the creation of index.jelly
, the current approach:
- assumes there is a
<description>
in the POM - lead to think you have to delete the
<description>
from your POM
IMO this could be improved for plugins author's UX. If the description is present but the the file is not, I assume the author:
- doesn't need to create a file when it's content is predictive (because we have the description)
- doesn't want the content of
index.jelly
to be different from the description
This PR aims to provide the following behaviours:
-
In case the
index.jelly
file doesn't exist and the description is provided, create the file undertarget/classes
and log a warning -
In case the
index.jelly
file doesn't exist and the description is not provided, then throw an error to enforce the creation of the file by the author -
In case the
index.jelly
file is provided, use it -
[x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
-
[x] Ensure that the pull request title represents the desired changelog entry
-
[x] Please describe what you did
-
[ ] Link to relevant issues in GitHub or Jira
-
[x] Link to relevant pull requests, esp. upstream and downstream changes
-
[x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
I'm not at ease thinking that hpi:hpi
can somehow write under src/
directory.
Such goal should always be reproducible, and here if you call it twice, the first call will fail, and the second one will succeed.
Adding a separate goal to implement such behaviour would be acceptable IMO.
I'm not sure generating sources outside directories expected to contain something like that is expected. Since users will need to git add
the file and commit it, there's no actual automation here.
I could see an argument for generating the index.jelly
from POM description in the target/
though, OTOH a case could be made that developers are expected to provide a better description, e.g. (limited) HTML formatting is possible here.
Sorry for maybe being unclear: the generated file is in target/classes
, not in any source directory, see
Sorry for maybe being unclear: the generated file is in
target/classes
, not in any source directory, see
Ah, I was confused by the path in the error message 🤦
Sorry for maybe being unclear: the generated file is in
target/classes
, not in any source directory, see
I got confused as well. Looks okay to me. CI still needs fixing.
I don't understand the current tests failures as in the output, there is the message which is checked in the logs 🤷
Closing as stale. Nobody approved it in a year.