I have a top-level maven project with submodules. The first submodule is a Java project which generates some JavaScript library code from the compiler's annotation processor. I want to include those generated JS files into the second submodule, a webpack NPM managed project, for the build and then publish the webpack BACK into the first submodule before packaging into a fat-jar. Does anyone know of a way to accomplish this?
Multimodule Maven Project with interdependencies?
225 Views Asked by Deven Phillips At
1
There are 1 best solutions below
Related Questions in MAVEN
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- JavaFX build generating a blank gui with primary view and secondary view buttons
- Maven (Java) does not build dependencies into a compiled file
- java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.TagLibraryValidator in Spring-boot jsp application
- I am trying to use h2 in-memory db from my spring boot application, my spring boot version is 3.1.10, but its not connecting to h2 properly
- BeanCreationException when deploying Spring Boot app
- How to run Parallel tests by groups using Maven and TestNG?
- Get control flow information with JaCoCo
- Failed to instantiate [com.docusign.esign.client.ApiClient]
- Gradle - Groovy vs Gradle - Kotlin vs Maven for Java Spring Boot web application project on IntelliJ
- Intelij ultimate and spring boot giving me errors
- Using Eclipse Maven project, import new version of a class from a jar file created from another Maven project
- Messing up with conflict between spring jcl and commons-logging.jar
- Run java program
- How to add a Maven project to an Ubuntu image in Docker
Related Questions in MULTI-MODULE
- Handling related Room entities with Clean Architecture in a multi-module project on Android
- Is it possible to use Room Database in a Kotlin Library module?
- Add lombok plugin to multimodule gradle build
- Separating command from query in the spring boot CQRS projects(Multi module)
- Best Practice for Using Fake Objects in Multi-Module Projects for Testing
- Quarkus multi-module Maven project with integration tests, problems with including quarkus-maven-plugin multiple times, for each module?
- Springboot_multimodule_project_error
- String boot multi module application running
- Multi-module java-platform gradle build like maven bom
- Gradle multi module project upgrade to java 21 and spring boot 3.x.x module by module
- Muti-module Springboot project active profile not success
- Circular dependency when publishing to jitpack
- gradle not recognizing local modules after adding product flavors to my android app
- Multi-module architecture has me confused
- Multi Module Application Database Connection - Spring Boot, Postgres
Related Questions in MAVEN-REACTOR
- Maven reactor: Is it possible to build only the dependencies of a specific module, but not the module itself?
- Why is an imported pom module not ordered at the beginning of the maven multi-module reactor build?
- Maven Reactor Build Order Print Format
- How to Build Maven Modules in Parallel in Separate JVMs
- avoid need for maven install with multi-module maven project
- Dependencies' jar-s copied by maven-dependency-plugin aren't installed to local repository
- Can I get the Maven reactor to use different names?
- How do I copy a file using Maven and specify the first module as the target folder?
- Why does Spring Boot Maven plugin mess up repackaging my reactor module sometimes?
- Is there a way to perform "mvn clean install" on multiple separate modules, when all the modules have different parents which can't be altered?
- Is there any way to perform MVN clean install on multiple separate modules in a particular sequence apart from shell script or batch script?
- Maven reactor with project aggregation and work dir problem
- Building dependencies of dependents and dependents of dependencies
- Maven enforcer issue when running from reactor level
- Build Multi Module project with Maven in Jenkins
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
What you describe is a circular dependency. You have to break this circular dependency. (You probably do similar things in your code all the time.)
I have solved the same problem by breaking up the Java project. Once you do that you will recognize that, in fact, your first project was serving two separate roles that then become separated:
From:
To:
I've often seen this happen in multi-module projects that build into a WAR file, and I've adopted the rule of thumb that the WAR project should not have any Java (production) code, acknowledging its role as the aggregator/assembler.
Some folks will think this third project is frivolous, some always argue that you're easily getting too many Maven modules. I think that often stems from tooling or build pipeline limitations, once you break through those, you can just embrace a growing number of Maven modules, given that the boundaries are chosen well, and I see no problems here.
One hesitation, though: why is the JavaScript project separate to begin with? If it is not deployed separately (evidently it isn't since you're assembling the "fat-jar"), the JavaScript code is following the delivery lifecycle of the "fat-jar", which would benefit from being in the same source repository, so why even make it a separate Maven module? (If they were in separate source repositories, there's a cost in version management between the modules that I'm unsure you have reasons for.) There's no shame in having a monolith (if done well -- it happens, microservices make you believe otherwise, but in that world you'd probably deploy the JavaScript code separately anyway).