Le mar. 17 oct. 2023 à 23:55, Benjamin Marwell <bmarw...@apache.org> a écrit :
> Hey all, > > In a mockito issue, JDK maintainers suggested to differentiate between > agents and normal dependencies. Starting with JDK 21 already, this makes a > lot of sense: dynamic loading of agents will be a no-go. > > One suggestion was: > > <dependencies> > <dependency> > ... > </dependency> > <agents> > <dependency> > ... > </dependency> > </agents> > </dependencies> > > Not sure if this is the best way, but this is something similar might be > needed. > Currently, the only way to handle agents is to add them manually to the > surefire argLine. To make things worse, a deoendency goal is needed until > Romains PR is merged: > https://github.com/apache/maven/pull/1281 > > Another issue is that a parent pom might not be able to easily define this > option. There were some concerns that part of the configuration needed to > be repeated in every module. > > So, I wrote Maven 5. > Maven 4 is the stepping stone to the build/consumer pom. But this is an > extension. Not really a breaking change in terms of parsing, but in terms > of building a project. Thus, it should go onto the roadmap. > We could definitely do that in Maven 4. With alpha-8, the model is now more open to changes. See how it's done in https://github.com/apache/maven/pull/1209/files That said, I agree with @cstamas that it may be better represented using an ArtifactHandler. However, the use of agents looks like a very specific use case. You have very few cases where agents can be used, as the requirement is to create a JVM. So that would be for the whole Maven JVM and that would be handled by core extensions, or by plugins that fork JVM. Are there many plugins apart from Surefire, Maven Invoker or Exec plugin ? I suspect the configuration needs to be different for each of these tool... so I'm not completely sure adding an <agents> section, or even an artifact handler is actually the best solution. Guillaume > > ... unless you want to keep the current status quo, which is also an > option. But before making an argument here, I'd recommend reading the > lengthy (sorry!) discussion on the mockito issue tracker. Since Karl Heinz > started the issue, I'd love to hear back from you, too. Link: > https://github.com/mockito/mockito/issues/3037 > > If no discussion is needed at this point, let's keep this as a reminder for > the next Apero and/or Maven 5 then. > > - Ben > -- ------------------------ Guillaume Nodet