Hi.
I checked the xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>acm_test</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>acm_test</name>

    <properties>
        <maven.compiler.source>23</maven.compiler.source>
        <maven.compiler.target>23</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <configuration>
                    <goalPrefix combine.self="override"/>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

it can pass xsd check(maven-4.0.0.xsd), using dom4j.
can you provide an example pom for the wrong validation situation?


Gary Gregory <garydgreg...@gmail.com> 于2025年1月17日周五 21:23写道:

> As a tangent "combine.self" shows up as an XML validation failure in
> maven-v4_0_0.xsd, which confusingly is used with Maven 3.
>
> It would be nice to be able to validate XML properly.
>
> Gary
>
> On Fri, Jan 17, 2025, 04:44 Guillaume Nodet <gno...@apache.org> wrote:
>
> > The code has undergone major refactoring in the past months, so any
> pointer
> > you could find would be useless imho.
> > Basically, focus on impl/maven-impl and impl/maven-core, the other
> > subprojects are APIs or compatibility and should rarely be touched.
> > In your case, you're willing to alter the main model, which is located at
> >
> >
> >
> https://github.com/apache/maven/blob/master/api/maven-api-model/src/main/mdo/maven.mdo
> > A bunch of classes are generated from this file, just rebuild the whole
> > project.
> >
> > However, before trying to modify the model, I wonder if you can try
> > something like the following in the child:
> > <dependencies combine.self="override">
> >    ...
> > </dependencies>
> > This attribute is currently only used in XML configuration (so mainly for
> > plugin config), but maybe it would make sense to reuse it.
> >
> > And first, I'd also investigate the <scope>none</scope> idea, as this is
> > supposed to work afaik.
> >
> > Le ven. 17 janv. 2025 à 09:35, Xeno Amess <xenoam...@gmail.com> a écrit
> :
> >
> > > btw is there any good ways to learn about the details of the maven
> > project?
> > > etc books, or some articles, tutorials
> > > I read https://cwiki.apache.org/confluence/display/MAVEN/Index and
> found
> > > nearly nothing useful for starters...
> > > I mean, not tutorial for how to use maven, but for how to
> > > design/modify/develop maven
> > >
> > > Xeno Amess <xenoam...@gmail.com> 于2025年1月17日周五 15:46写道:
> > >
> > > > jira ticket opened: https://issues.apache.org/jira/browse/MNG-8526
> > > >
> > > > mdo file modified, and please if any guy have any ideas please let me
> > > know
> > > >
> > > > Xeno Amess <xenoam...@gmail.com> 于2024年10月12日周六 10:45写道:
> > > >
> > > >> well I would like to implement the codes and fire a jira ticket this
> > > >> month, since seems nobody be strongly reject this...
> > > >>
> > > >> Richard Eckart de Castilho <r...@apache.org> 于2024年9月25日周三 23:26写道:
> > > >>
> > > >>> Ran into this also recently (again).
> > > >>>
> > > >>> I believe a good way to solve this would be to allow overriding a
> > > >>> dependency
> > > >>> inherited from the parent POM with `<scope>none</scope>` or
> something
> > > >>> like that.
> > > >>>
> > > >>> I tried overriding with `<scope>provided</scope>` but for some
> reason
> > > >>> that didn't seem to work.
> > > >>>
> > > >>> The context was trying that I typically have `slf4j-simple` as a
> test
> > > >>> dependency for all
> > > >>> modules so I had added that to the parent, but then I had one
> module
> > > >>> where I absolutely
> > > >>> needed to use the log4j SLF4J binding and I couldn't get rid of the
> > > >>> `slf4j-simple` then
> > > >>> just for that module.
> > > >>>
> > > >>> That said, in general I would advise against inheriting
> dependencies
> > > >>> from parents.
> > > >>> Typically, you inherit too much and that means you'll have to add
> > > >>> excludes for the
> > > >>> dependency analyzer plugin as well... it's a mess.
> > > >>>
> > > >>> -- Richard
> > > >>>
> > > >>> > On 25. Sep 2024, at 17:17, Xeno Amess <xenoam...@gmail.com>
> wrote:
> > > >>> >
> > > >>> > and another idea be we could add a <exclusions> and
> > > >>> <exclusionManagement>
> > > >>> > (kind of mirror to dependencies and dependencyManagement) to
> remove
> > > >>> those
> > > >>> > dependencies from parent &EVERY dependency...
> > > >>> >
> > > >>> > Xeno Amess <xenoam...@gmail.com> 于2024年9月25日周三 22:59写道:
> > > >>> >
> > > >>> >> Hi.
> > > >>> >>
> > > >>> >> In maven3 we cannot exclude dependencies inherited from parent.
> > > >>> >>
> > > >>> >> see this
> > > >>> >>
> > > >>> >>
> > > >>>
> > >
> >
> https://stackoverflow.com/questions/2681759/is-there-anyway-to-exclude-artifacts-inherited-from-a-parent-pom
> > > >>> >>
> > > >>> >> That be kind of annoying if situation comes to be the parent-pom
> > be
> > > >>> >> maintained by others, and you extend it and it works fine until
> > one
> > > >>> day
> > > >>> >> they suddenlly decide to depend on some packages you would never
> > > make
> > > >>> >> compatible/useless, and you have no permission to change their
> > mind.
> > > >>> >> What I wanna do is adding such a gramma like this:
> > > >>> >>
> > > >>> >> <parent>
> > > >>> >>  <artifactId>base</artifactId>
> > > >>> >>  <groupId>es.uniovi.innova</groupId>
> > > >>> >>  <version>1.0.0</version>
> > > >>> >>  <exclusions>
> > > >>> >>    <exclusion>
> > > >>> >>      <groupId>javax.mail</groupId>
> > > >>> >>      <artifactId>mail</artifactId>
> > > >>> >>    </exclusion>
> > > >>> >>  </exclusions>
> > > >>> >> </parent>
> > > >>> >>
> > > >>> >> '
> > > >>> >> but I wanna hear about your opinions first.
> > > >>> >>
> > > >>>
> > > >>>
> > > >>>
> ---------------------------------------------------------------------
> > > >>> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> > > >>> For additional commands, e-mail: dev-h...@maven.apache.org
> > > >>>
> > > >>>
> > >
> >
> >
> > --
> > ------------------------
> > Guillaume Nodet
> >
>

Reply via email to