[xwiki-devs] [Proposal] Changing the location of XED files
Hi devs, In XWiki 9.0RC1 we’re putting XED files in WEB-INF/lib next to the JAR to which they correspond. I have 2 issues with this: * We’re not really supposed to use WEB-INF/lib for that. WEB-INF/lib is meant for JAR files that are to be made available to the classloader. It’s even possible that some servlet container would emit warnings about this. * This is a WTF for admins when they discover this. The WAR has a spec and it’s standardised. Thus the WTF when you see this since you’re not used to seeing this anywhere else. I’m thus proposing to move the XED files to a META-INF/xwiki/ directory inside the WAR instead since META-INF is meant to contain metadata information and is thus meant exactly for this. WDTY? Thanks -Vincent
The current scanner implementation is easy, it ask for all the accessible jars in the classloader and check if there is a .xed next to it to get better descriptor that anything it could find in the JAR (if there is even anything). It does not need care about where the JAR come from. What you propose is more complex and error prone. On Tue, Jan 24, 2017 at 1:26 PM, Vincent Massol <[email protected]> wrote:
Hi devs,
In XWiki 9.0RC1 we’re putting XED files in WEB-INF/lib next to the JAR to which they correspond.
I have 2 issues with this: * We’re not really supposed to use WEB-INF/lib for that. WEB-INF/lib is meant for JAR files that are to be made available to the classloader. It’s even possible that some servlet container would emit warnings about this. * This is a WTF for admins when they discover this. The WAR has a spec and it’s standardised. Thus the WTF when you see this since you’re not used to seeing this anywhere else.
I’m thus proposing to move the XED files to a META-INF/xwiki/ directory inside the WAR instead since META-INF is meant to contain metadata information and is thus meant exactly for this.
WDTY?
Thanks -Vincent
-- Thomas Mortagne
On 24 Jan 2017, at 15:00, Thomas Mortagne <[email protected]> wrote:
The current scanner implementation is easy, it ask for all the accessible jars in the classloader and check if there is a .xed next to it to get better descriptor that anything it could find in the JAR (if there is even anything). It does not need care about where the JAR come from. What you propose is more complex and error prone.
I don’t consider this to be a good-enough reason for the downsides I’ve listed. Maybe I’m missing something but it doesn’t sound too hard to change the location. I guess what you are doing is removing the last 3 characters and replace “jar” by “xed”. Since a WAR has a fixed format all that is needed is to go up the path: we know that the first “/“ from the end is the “lib” delimiter and one more is the “WEB-INF” one. Basically we need to: * Save the last path portion and replace “jar” by “xed”. Let’s call this XEDFILENAME * Replace "WEB-INF” and everything that comes after by “META-INF/xwiki/xed/“ + XEDFILENAME Do you see any problem with that? In any case I’d like first to hear what the others have to say on this topic to know if my proposal sounds good or not. Thanks -Vincent
On Tue, Jan 24, 2017 at 1:26 PM, Vincent Massol <[email protected]> wrote:
Hi devs,
In XWiki 9.0RC1 we’re putting XED files in WEB-INF/lib next to the JAR to which they correspond.
I have 2 issues with this: * We’re not really supposed to use WEB-INF/lib for that. WEB-INF/lib is meant for JAR files that are to be made available to the classloader. It’s even possible that some servlet container would emit warnings about this. * This is a WTF for admins when they discover this. The WAR has a spec and it’s standardised. Thus the WTF when you see this since you’re not used to seeing this anywhere else.
I’m thus proposing to move the XED files to a META-INF/xwiki/ directory inside the WAR instead since META-INF is meant to contain metadata information and is thus meant exactly for this.
WDTY?
Thanks -Vincent
-- Thomas Mortagne
On Tue, Jan 24, 2017 at 3:11 PM, Vincent Massol <[email protected]> wrote:
On 24 Jan 2017, at 15:00, Thomas Mortagne <[email protected]> wrote:
The current scanner implementation is easy, it ask for all the accessible jars in the classloader and check if there is a .xed next to it to get better descriptor that anything it could find in the JAR (if there is even anything). It does not need care about where the JAR come from. What you propose is more complex and error prone.
I don’t consider this to be a good-enough reason for the downsides I’ve listed. Maybe I’m missing something but it doesn’t sound too hard to change the location. I guess what you are doing is removing the last 3 characters and replace “jar” by “xed”. Since a WAR has a fixed format all that is needed is to go up the path: we know that the first “/“ from the end is the “lib” delimiter and one more is the “WEB-INF” one.
Basically we need to: * Save the last path portion and replace “jar” by “xed”. Let’s call this XEDFILENAME * Replace "WEB-INF” and everything that comes after by “META-INF/xwiki/xed/“ + XEDFILENAME
Do you see any problem with that?
In any case I’d like first to hear what the others have to say on this topic to know if my proposal sounds good or not.
Thanks -Vincent
On Tue, Jan 24, 2017 at 1:26 PM, Vincent Massol <[email protected]> wrote:
Hi devs,
In XWiki 9.0RC1 we’re putting XED files in WEB-INF/lib next to the JAR to which they correspond.
I have 2 issues with this: * We’re not really supposed to use WEB-INF/lib for that. WEB-INF/lib is meant for JAR files that are to be made available to the classloader. It’s even possible that some servlet container would emit warnings about this. * This is a WTF for admins when they discover this. The WAR has a spec and it’s standardised. Thus the WTF when you see this since you’re not used to seeing this anywhere else.
Could you give a reference to the specification forbidding to put anything else that JAR files in WEB-INF/lib.
I’m thus proposing to move the XED files to a META-INF/xwiki/ directory inside the WAR instead since META-INF is meant to contain metadata information and is thus meant exactly for this.
WDTY?
Thanks -Vincent
-- Thomas Mortagne
-- Thomas Mortagne
On 24 Jan 2017, at 15:36, Thomas Mortagne <[email protected]> wrote:
[snip]
In XWiki 9.0RC1 we’re putting XED files in WEB-INF/lib next to the JAR to which they correspond.
I have 2 issues with this: * We’re not really supposed to use WEB-INF/lib for that. WEB-INF/lib is meant for JAR files that are to be made available to the classloader. It’s even possible that some servlet container would emit warnings about this. * This is a WTF for admins when they discover this. The WAR has a spec and it’s standardised. Thus the WTF when you see this since you’re not used to seeing this anywhere else.
Could you give a reference to the specification forbidding to put anything else that JAR files in WEB-INF/lib.
The spec is not that precise but it doesn’t matter much. The main point is that admins are used to see only JAR files in WEB-INF/lib and it’s not the place for metadata files. META-INF/ seems a much nicer location for that. My belief is that if you ask anyone where they think these metadata files should go between: A) in WEB-INF/lib B) in META-INF/xwiki they’d choose B. But I want to verify this, hence this proposal. Thanks -Vincent
I’m thus proposing to move the XED files to a META-INF/xwiki/ directory inside the WAR instead since META-INF is meant to contain metadata information and is thus meant exactly for this.
WDTY?
Thanks -Vincent
I don't have a problem with keeping the XED files in WEB-INF/lib if the spec doesn't forbid it, especially if it simplifies the implementation. Thanks, Marius On Tue, Jan 24, 2017 at 2:26 PM, Vincent Massol <[email protected]> wrote:
Hi devs,
In XWiki 9.0RC1 we’re putting XED files in WEB-INF/lib next to the JAR to which they correspond.
I have 2 issues with this: * We’re not really supposed to use WEB-INF/lib for that. WEB-INF/lib is meant for JAR files that are to be made available to the classloader. It’s even possible that some servlet container would emit warnings about this. * This is a WTF for admins when they discover this. The WAR has a spec and it’s standardised. Thus the WTF when you see this since you’re not used to seeing this anywhere else.
I’m thus proposing to move the XED files to a META-INF/xwiki/ directory inside the WAR instead since META-INF is meant to contain metadata information and is thus meant exactly for this.
WDTY?
Thanks -Vincent
participants (3)
-
Marius Dumitru Florea -
Thomas Mortagne -
Vincent Massol