You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "zosrothko (Jira)" <ji...@apache.org> on 2022/02/23 08:45:00 UTC
[jira] [Comment Edited] (MNG-7419) Add overiding dependencies from a BOM dependencyManagement
[ https://issues.apache.org/jira/browse/MNG-7419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17496566#comment-17496566 ]
zosrothko edited comment on MNG-7419 at 2/23/22, 8:44 AM:
----------------------------------------------------------
WIth maven 3.8.4
{code:java}
D:\MXW\IC\4.5\IC>mvn -version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: C:\ASF\apache-maven-3.8.4
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_181\jre
Default locale: fr_FR, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
{code}
the following BOM is rejected
{code:java}
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.scort</groupId>
<artifactId>mi</artifactId>
<version>4.5.0</version>
<scope>import</scope>
<type>pom</type>
<dependencies>
<dependency>
<groupId>com.scort.mi</groupId>
<artifactId>scortsmpaas</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</dependency>
</dependencies>
</dependencyManagement>
{code}
{code:java}
D:\MXW\IC\4.5\IC>mvn clean install
[INFO] Scanning for projects...
Downloading from snapshot: https://nexus.metrixware.com/repository/snapshot/com/scort/2021.11-SNAPSHOT/maven-metadata.xml
Downloaded from snapshot: https://nexus.metrixware.com/repository/snapshot/com/scort/2021.11-SNAPSHOT/maven-metadata.xml (589 B at 596 B/s)
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Malformed POM D:\MXW\IC\4.5\IC\pom.xml: Unrecognised tag: 'dependencies' (position: START_TAG seen ...</type>\r\n\t\t\t\t<dependencies>... @28:19) @ D:\MXW\IC\4.5\IC\pom.xml, line 28, column 19
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.scort.test:ic:1.2.1-SNAPSHOT (D:\MXW\IC\4.5\IC\pom.xml) has 1 error
[ERROR] Malformed POM D:\MXW\IC\4.5\IC\pom.xml: Unrecognised tag: 'dependencies' (position: START_TAG seen ...</type>\r\n\t\t\t\t<dependencies>... @28:19) @ D:\MXW\IC\4.5\IC\pom.xml, line 28, column 19 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
{code}
was (Author: zosrothko):
WIth maven 3.8.4
{code:java}
D:\MXW\IC\4.5\IC>mvn -version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: C:\ASF\apache-maven-3.8.4
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_181\jre
Default locale: fr_FR, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
{code}
the following BOM is rejected
{code:java}
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.scort</groupId>
<artifactId>mi</artifactId>
<version>4.5.0</version>
<scope>import</scope>
<type>pom</type>
<dependencies>
<dependency>
<groupId></groupId>
<artifactId></artifactId>
</dependency>
</dependencies>
</dependency>
</dependencies>
</dependencyManagement>
{code}
{code:java}
D:\MXW\IC\4.5\IC>mvn clean install
[INFO] Scanning for projects...
Downloading from snapshot: https://nexus.metrixware.com/repository/snapshot/com/scort/2021.11-SNAPSHOT/maven-metadata.xml
Downloaded from snapshot: https://nexus.metrixware.com/repository/snapshot/com/scort/2021.11-SNAPSHOT/maven-metadata.xml (589 B at 596 B/s)
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Malformed POM D:\MXW\IC\4.5\IC\pom.xml: Unrecognised tag: 'dependencies' (position: START_TAG seen ...</type>\r\n\t\t\t\t<dependencies>... @28:19) @ D:\MXW\IC\4.5\IC\pom.xml, line 28, column 19
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.scort.test:ic:1.2.1-SNAPSHOT (D:\MXW\IC\4.5\IC\pom.xml) has 1 error
[ERROR] Malformed POM D:\MXW\IC\4.5\IC\pom.xml: Unrecognised tag: 'dependencies' (position: START_TAG seen ...</type>\r\n\t\t\t\t<dependencies>... @28:19) @ D:\MXW\IC\4.5\IC\pom.xml, line 28, column 19 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
{code}
> Add overiding dependencies from a BOM dependencyManagement
> ----------------------------------------------------------
>
> Key: MNG-7419
> URL: https://issues.apache.org/jira/browse/MNG-7419
> Project: Maven
> Issue Type: New Feature
> Components: Dependencies
> Environment: Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
> Maven home: C:\ASF\apache-maven-3.6.3\bin\..
> Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_181\jre
> Default locale: fr_FR, platform encoding: Cp1252
> OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
> Reporter: zosrothko
> Priority: Major
> Labels: BOM
>
> Hello
> By looking at [MNG-5102|https://issues.apache.org/jira/browse/MNG-5102], I finally manage my BOM problem. But I need an extension that allows the imported BOM to be overriden by some new dependencies specs. As for exemple
> {code:java}
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>com.scort</groupId>
> <artifactId>mi</artifactId>
> <version>4.4.0</version>
> <scope>import</scope>
> <type>pom</type>
> <dependencies>
> <dependency>
> <groupId>foo</groupId>
> <artifactId>bar</artifactId>
> <scope>provided</scope>
> </dependecy>
> </dependencies>
> </dependency>
> {code}
> The use case is the case where a customer wants to integrate the com.scor:mi jars in a war to run on Tomcat for exemple, while it would like also to integrate com.scort:mi jars as a module of a JBoss server, in which case, the artifacts should be marked as provided.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)