[MAGNOLIA-6248] A sub-directory should be set in magnolia.properties: magnolia.resources.dir Created: 05/Jun/15  Updated: 15/Oct/20  Resolved: 24/Aug/16

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 5.4
Fix Version/s: 5.5

Type: Improvement Priority: Major
Reporter: Christopher Zimmermann Assignee: Evzen Fochr
Resolution: Fixed Votes: 0
Labels: quickwin
Remaining Estimate: 0d
Time Spent: 6.5h
Original Estimate: 1h

Issue Links:
dependency
depends upon MAGNOLIA-6214 FreeMarker template scripts should be... Closed
is depended upon by MGNLCE-53 Copy modules folder to public instance Closed
is depended upon by MGNLEE-452 Copy modules folder to public instance Closed
relation
is related to MAGNOLIA-6681 Do not log INFO messages about modifi... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Sprint: Kromeriz 58
Story Points: 2

 Description   

This feature is more friendly if there is a subdirectory in the magnolia home directory. Otherwise people are putting their modules directly into the cluttered magnolia.home directory. Of course this is just a nice default - the developer can change it. The directory should be called "modules".

  • In the default magnolia.properties file,
    magnolia.resources.dir=${magnolia.home}/modules
  • The "modules" directory should be created automatically. That is, it should already exist on a fresh instantiation of the webapp.


 Comments   
Comment by Mikaël Geljić [ 09/Jun/15 ]

Hmmm,

  1. We were pondering about that when we implemented handling of this property, and yet still chose to use ${magnolia.home}. I think it's OK as a reasonable default, not sure which of the few sibling directories are bugging you most?
  2. We anyway encourage (at least in production) magnolia.home to be put outside of your webapp

Not saying it's totally invalid, but at least requires proper discussion.

Comment by Christopher Zimmermann [ 29/Jun/15 ]

Its not one of the sibling directories - its that there are sibling directories at all.
It is confusing for a developer to have one directory which has subdirectories:

  • cache
  • docroot
  • logs
  • META-INF
  • repositories
  • tmp
  • WEB-INF

plus whatever light modules they decide to add.

I think a developer would be much happier if there was one directory in which they could place all their light modules. This would make their modules easier to work with in the file system, easier to work with in a text editor (import one directory) - and it would make it more clear which modules they had actually created.

*

I think it is not that relevant that magnolia.home can be put out of your webapp. Whereever magnolia.home is - it would be better if there was by default a different directory where someone can put their modules.

*

Especially for beginners or evaluators, (And this is a of course a focus of 5.4) things should be as logical and clear as possible. I think people who try it will feel more comfortable putting their light module in a an empty "light-module" directory than in the home directory for the reasons already mentioned.
We dont want to add an extra step to intro tutorials "find the magnolia.properties file, set the magnolia.resources.dir to .....".

Comment by Christoph Meier [ 29/Jun/15 ]

I agree.
This would be "helpful" or at least it keeps the structure cleaner.
Good idea!

Comment by Mikaël Geljić [ 15/Sep/15 ]
  • For naming, on technical grounds I'd call it "resources" if anything. Yet, I see the point for beginners/evaluators: "light-modules", or simply "modules" could also make sense. (simply "modules" because light dev is becoming standard dev, and for newbies, there's nothing light because they never knew the heavy counterpart ).

Yet, I was always a bit hesitant when it came to choosing a default:

  • If it's just for the sake of beginners/evaluators, why make such a project decision for the more experienced guys?
  • empty-webapp is to start building a project upon, while demoing/evaluating could happen in a different webapp/bundle/project. Then we would also help those asking: "I want to start off with CE or EE but without the demo".

Just food for thought, any decision will do really.

Comment by Christopher Zimmermann [ 12/Jan/16 ]

After consultation with members in services team, PM decided on name "modules" for the directory.

Comment by Evzen Fochr [ 17/Aug/16 ]

Waiting for final decision. czimmermann mgeljic

Comment by Roman Kovařík [ 20/Aug/16 ]

Reopened: ResourcesAppUITest needs to be adjusted.

Comment by Jaroslav Simak [ 23/Aug/16 ]

Reopened:
http://pastebin.com/4sVyFeXg

Comment by Evzen Fochr [ 23/Aug/16 ]

can be closed after MGNLCE-53 and MGNLEE-452 are resolved

Comment by Richard Gange [ 15/Oct/20 ]

Let me also mention here that if you use this setting:

magnolia.resources.dir=${magnolia.home}

Then it will slow down publication because observing the tmp directory will trigger the DirectoryWatcher (see MAGNOLIA-6681).

This can be avoided by using one the changes mentioned in MAGNOLIA-6248 or MAGNOLIA-6434.

Generated at Mon Feb 12 04:12:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.