My Maven project has a unique structure that includes:
- "Base" module -- containing shared Java files -- should also include shared JavaScript files
- Module 1 -- using shared Java files as a Maven dependency -- should utilize shared JavaScript files through ?
- Module 2 -- utilizing shared Java files as a Maven dependency -- should incorporate shared JavaScript files using ?
Recently, I have noticed that webpack is gaining popularity in packaging JavaScript and npm serves as a reliable package manager. So, here's what I attempted: - The base module creates an npm bundle (using npm pack) with webpack - Modules 1 and 2 manually install this bundle by referencing the relative path to the target folder of the base module where the npm package resides
Why did I avoid using npm publish? - Updating published npm packages isn't feasible because it requires incrementing version numbers for each build - It necessitates an internet connection during the building process
Are there other options available? - One alternative I considered was employing the Maven resources plugin, but it seemed labor-intensive due to the manual aspects involved (such as file names, folder structures, etc.)
So my question is: How do you share JavaScript code among Maven modules within the same project? Is there a more efficient way to accomplish this task?
If you're interested in exploring my project further, feel free to visit: https://github.com/stefanrinderle/softvis3d
I appreciate any insights or feedback you may provide!