Closed tecklead closed 2 weeks ago
I see two task to implement this:
pom
-packaging type in PublishModule
JavaModule
, which has dependency management but no compilation setup (This is needed to handle pom-packaging modules locally when resolving modules transitively. It may also become handy as a leaner baseline for concrete run modules, which need to resolve their deps but don't want to compile anything.)@tecklead Can you clarify whether in Maven pom-packaging modules compilation is possible at all? Is it optional or even disallowed? Can pom-packaging modules have tests?
@lefou In our case, we don't have any code/tests in pom-packaging modules. referred springboot-starter-web and looks like they also don't have any code.
IMHO, In Maven, when you define a module with pom packaging, it serves as a container for other modules but does not produce a deployable artifact like a JAR or WAR. This is typically used for parent projects that aggregate several sub-modules.
POM Packaging Module:
A module with <packaging>pom</packaging> does not produce a JAR or WAR.
It is primarily used to manage and build multiple sub-modules as a single unit.
This type of module often contains configuration that is inherited by sub-modules, such as dependency management, plugin configurations, and build settings.
Dependency Resolution:
When a module with pom packaging is used as a dependency, Maven will download the POM file of that module.
The downloaded POM file may contain dependency management, plugins, and other settings that will be applied to the consuming project.
Spring Boot Starters:
Spring Boot starters, such as spring-boot-starter-web, typically depend on multiple libraries needed for a particular use case (like web development).
These starters usually use jar packaging, but they pull in other dependencies that provide the actual implementation.
Testing in POM Modules:
It is common not to have code or tests directly in a POM packaging module.
Tests are generally placed in sub-modules that produce deployable artifacts.
References :-
https://maven.apache.org/pom.html#aggregation-or-multi-module https://www.baeldung.com/maven-packaging-types
Description:
In Maven, the packaging attribute allows for publishing
pom
artifacts. This is particularly useful for creating parent POMs that can be used as dependencies in other projects. Here is an example of how this works in Maven: Example POM Configuration:With the above configuration, the
com.example.abc-starter
artifact can be referenced as a parent in another POM: Example Usage in aConsumer
POM:Request:
It would be highly beneficial if Mill could provide similar support for publishing pom artifacts. This would allow for the creation of parent POMs that can be used as dependencies in consumer POMs using the same syntax as shown above.
Benefits:
Thank you for considering this feature request!