Hi,
while preparing several plugins for pure Maven3, I hit a couple of issues.
My goal is to not depend on deprecated methods anymore, so here are some
suggestions.
1. Un-deprecate ArtifactMetadata OR add ProjectArtifactMetadata to Artifact
For every artifact (both main and attached) there's a need to have a
reference to the descriptor (the pom.xml). Up until now this is solved by
having a ProjectArtifactMetadata accessible via
Collection<ArtifactMetadata> Artifact.getMetadataList(). However,
ArtifactMetadata is marked as deprecated. ProjectArtifactMetadata is the
only ArtifactMetadata that is still used, all others are ignored.
There are probably 2 solutions to avoid usage of this deprecated class:
Undeprecate ArtifactMetadata or add ProjectArtifactMetadata to Artifact
(e.g. getProjectArtifactMetadata() )
Be aware that Artifact is an interface and adding methods will break
compatibility for custom implementations.
Adding a new interface is also a solution, but doesn't make the code more
readable.
(just a +1 for this bullet not enough here...)
2. Deprecate ArtifactFilter in favor of DependencyNodeFilter (from
maven-dependency-tree)
The maven-assembly-plugin requires functionality to filter
artifacts/dependencies, so I need to add such feature to the
maven-artifact-transfer component. I'm struggling with the need to
translate an ArtifactFilter to an Aether DependencyFilter.
In the end these filters only use the <dependency>-information. An
artifact has much more information, like how it resolved, repository
locations, etc.
Current architecture has changed the approach:
1. resolve the tree (based on pom.xml information)
2. download the artifacts and construct the corresponding Artifact
instance.
Plugins should do the same. If we keep the ArtifactFilter, there will have
a lot of overhead in the new resolveArtifact methods due to the switching
between Dependency(Node) and Artifact (and use deprecated ArtifactFactory
for creating invalid Artifacts), just to be able to use ArtifactFilters.
WDYT?
Robert
ps. These changes won't help us with the current migration of the plugins,
but could give us direction for the next major version of Maven.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]