[ https://issues.apache.org/jira/browse/MNG-8097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17904481#comment-17904481 ]
ASF GitHub Bot commented on MNG-8097: ------------------------------------- elharo commented on code in PR #529: URL: https://github.com/apache/maven-site/pull/529#discussion_r1878008186 ########## content/apt/pom.apt.vm: ########## @@ -271,13 +271,20 @@ mvn install:install-file -Dfile=non-maven-proj.jar -DgroupId=some.group -Dartifa you browse the Maven central repository, you will notice that the classifiers <<<sources>>> and <<<javadoc>>> are used to deploy the project source code and API docs along with the packaged class files. + The classifier may also be derived from the <<type>> in case the related {{{/ref/current/maven-core/artifact-handlers.html} artifact handler}} defines one. + * <<type>>:\ Corresponds to the chosen dependency type. This defaults to <<<jar>>>. While it usually represents - the extension on the filename of the dependency, that is not always the case: a type can be mapped to a + the extension of the referenced artifact, that is not always the case: a type can be mapped to a different extension and a classifier. The type often corresponds to the packaging used, though this is also not always the case. Some examples are <<<jar>>>, <<<ejb-client>>> and <<<test-jar>>>: see {{{/ref/current/maven-core/artifact-handlers.html}default artifact handlers}} for a list. New types can be defined by plugins that set <<<extensions>>> to true, so this is not a complete list. + + In case there is an artifact handler defined there are <two> different ways of referencing the same dependency: + By using the artifact's <extension> or by using the registered <type> value. The latter considers all attributes from the artifact handler, while the former Review Comment: sentence fragment ########## content/apt/pom.apt.vm: ########## @@ -271,13 +271,20 @@ mvn install:install-file -Dfile=non-maven-proj.jar -DgroupId=some.group -Dartifa you browse the Maven central repository, you will notice that the classifiers <<<sources>>> and <<<javadoc>>> are used to deploy the project source code and API docs along with the packaged class files. + The classifier may also be derived from the <<type>> in case the related {{{/ref/current/maven-core/artifact-handlers.html} artifact handler}} defines one. + * <<type>>:\ Corresponds to the chosen dependency type. This defaults to <<<jar>>>. While it usually represents - the extension on the filename of the dependency, that is not always the case: a type can be mapped to a + the extension of the referenced artifact, that is not always the case: a type can be mapped to a different extension and a classifier. The type often corresponds to the packaging used, though this is also not always the case. Some examples are <<<jar>>>, <<<ejb-client>>> and <<<test-jar>>>: see {{{/ref/current/maven-core/artifact-handlers.html}default artifact handlers}} for a list. New types can be defined by plugins that set <<<extensions>>> to true, so this is not a complete list. + + In case there is an artifact handler defined there are <two> different ways of referencing the same dependency: Review Comment: If an artifact handler is defined, ########## content/apt/pom.apt.vm: ########## @@ -271,13 +271,20 @@ mvn install:install-file -Dfile=non-maven-proj.jar -DgroupId=some.group -Dartifa you browse the Maven central repository, you will notice that the classifiers <<<sources>>> and <<<javadoc>>> are used to deploy the project source code and API docs along with the packaged class files. + The classifier may also be derived from the <<type>> in case the related {{{/ref/current/maven-core/artifact-handlers.html} artifact handler}} defines one. + * <<type>>:\ Corresponds to the chosen dependency type. This defaults to <<<jar>>>. While it usually represents - the extension on the filename of the dependency, that is not always the case: a type can be mapped to a + the extension of the referenced artifact, that is not always the case: a type can be mapped to a different extension and a classifier. The type often corresponds to the packaging used, though this is also not always the case. Some examples are <<<jar>>>, <<<ejb-client>>> and <<<test-jar>>>: see {{{/ref/current/maven-core/artifact-handlers.html}default artifact handlers}} for a list. New types can be defined by plugins that set <<<extensions>>> to true, so this is not a complete list. + + In case there is an artifact handler defined there are <two> different ways of referencing the same dependency: + By using the artifact's <extension> or by using the registered <type> value. The latter considers all attributes from the artifact handler, while the former + never adds the dependency to the classpath nor includes its dependencies. Further information in Review Comment: in --> can be found in > Validate that each dependency->type is a type registered in an artifact > handler > ------------------------------------------------------------------------------- > > Key: MNG-8097 > URL: https://issues.apache.org/jira/browse/MNG-8097 > Project: Maven > Issue Type: New Feature > Reporter: Konrad Windszus > Priority: Major > > Currently often the dependency's type is being set to the extension and the > resolution is lenient, i.e. if there is no artifact handler defining the > value given in {{dependency->type}} resolution transparently uses the type as > extension. > That can potentially lead to two issues: > 1. Resolution might fail with surprising error messages like > {code} > Could not resolve dependencies for project ....: The following artifacts > could not be resolved: <gav>: Could not transfer artifact > <groupId>:<artifactId>:<unknown-type>:<version> from/to ... > {code} > This is an issue for all types not defined by Maven Core itself, e.g. for > https://jackrabbit.apache.org/filevault-package-maven-plugin/index.html which > registers an artifact handler for type {{content-package}} with extension > {{zip}}. > 2. The information {{addedToClasspath}}, {{includesDependencies}} and > {{classifier}} from the artifact handler is not evaluated > Compare with > https://maven.apache.org/repositories/artifacts.html#but-where-do-i-set-artifact-extension -- This message was sent by Atlassian Jira (v8.20.10#820010)