Comments (15)
Let me try if the smart builder is considering the plugin dependencies when building the dependency tree. Adding -deployment
modules as dependencies of some plugin could be a viable workaround.
from maven-mvnd.
I thought using the code in https://github.com/gnodet/mvnd/pull/13 and building with -T1
would solve the problem, but no, it looks like the ordering of the modules is non-deterministic and build succeeds only sometimes. Interesting.
from maven-mvnd.
-T1 -bsinglethreaded
seems to work consistently as a workaround.
from maven-mvnd.
Yes, that's one of the problem with a parallel build: all dependencies must be explicitely defined, as we can't rely on the order in which modules are defined.
from maven-mvnd.
Yes, but Quarkus extensions are a bit special in this respect. The deployment module is not declared as a dependency by design. It does not suit any of the traditional Maven scopes. It is actually only pulled by the Quarkus plugin to be run at built time. So declaring it as a dependency of the Quarkus plugin seems be closest to what it really is (although the plugin does not require that). I will try whether the smart builder will honor the declaration and schedule the deployment module before the itest.
But anyway shouldn't mvnd offer an official way to adjust the build order? I can imagine many projects will have similar problems. E.g. a system property? Something like
<groupId>my-org</groupId>
<artifactId>my-itest</artifactId>
...
<properties>
<mvnd.schedule-after>my-org:ext1-deployment,my-org:ext2-deployment</mvnd.schedule-after>
</properties>
from maven-mvnd.
mvnd.schedule-after
is stupid. mvnd.schedule.after
would be more consistent.
from maven-mvnd.
Adding the deployment deps as plugin deps seems to solve the scheduling problem, but the effective result seems to be a corrupted local repo. Thinking so because the stock mnv is throwing the same errors in java.io
that go away (with the stock maven) when I delete the broken jars from the local repo.
Steps to reproduce should be
- Checkout this branch https://github.com/ppalaga/camel-quarkus/commits/191003-hidden-deps
- Remove all quarkus 2.23.2 artifacts from your local repo, e.g. using
find . -type d -name 0.23.2 -exec rm -Rf {} \;
mvnd clean install -DskipTests
from maven-mvnd.
The failures in the previous comment are caused by the fact that the Quarkus plugin does not like to have the deployment modules in its class path. So I tried to add the deployment modules as deps of another plugin see here https://github.com/ppalaga/camel-quarkus/commits/191003-hidden-deps.1 and it works! mvnd clean install -DskipTests
took ~26 sec instead of ~57 sec with the stock Maven!
from maven-mvnd.
So adding the hidden deps to some plugin is a valid workaround, but the question is still open whether mvnd
should offer an official way to reach the goal without having to add a plugin.
from maven-mvnd.
So adding the hidden deps to some plugin is a valid workaround, but the question is still open whether
mvnd
should offer an official way to reach the goal without having to add a plugin.
I agree we should provide a way to add dependencies for ordering purposes. Using properties definitely looks like a good way. However, I'd rather move such information in the parent pom rather than dispatched in the various modules. This would also enable to use wildcards to define those additional rules. This would also benefit camel which also has similar problems.
from maven-mvnd.
I'd rather move such information in the parent pom
I wonder what would it look like?
Would those be honored also when not building from the root dir?
Having it in the dependent module seems to have the following advantages:
- No need to write the dependent module, because it is implicitly clear - it is "this" module
- More robust when renaming/removing the dependent module
from maven-mvnd.
I've added support for top level rules for now. The syntax is the following:
<rules> ::= rule [ <rule-sep> <rule> ]+
<rule-sep> ::= '\n' | ';'
<rule> ::= <projects> <sep> <projects>
<sep> ::= ' before ' | ' -> '
<projects> ::= <project> [ <project-sep> <project> ]+
<project-sep> ::= ',' | 'and'
<project> ::= [ <groupId> ':' ]? <artifactId>
The groupId
and artifactId
supports the *
wildcard matcher. If the groupId
part is omitted, *
is implied.
The rules have to be defined as the mvnd.builder.rules
maven property.
from maven-mvnd.
A simple top level rule is
org.apache.camel.quarkus:*-deployment before org.apache.camel.quarkus.tests:*
from maven-mvnd.
We could also add support for non top-level rules where the right part of the rule would be implied to the current groupId:artifactId
.
from maven-mvnd.
Just added support for local rules defined using mvnd.builder.rule
where the right part is implied.
from maven-mvnd.
Related Issues (20)
- maven.config ${session.rootDirectory} interpolation is not working HOT 4
- exec clean package install command display garbled codes HOT 1
- Detect smart builder in .mvn/extensions.xml and ignore it
- Support comments in .mvn/maven.config (the same way as Maven does)
- Mvnd complains about comments in .mvn/maven.config
- Interpolation in .mvn/maven.config HOT 3
- String index out of range when paramter is malformed
- Would it be possible to have linux arm64 as a standard release asset? HOT 1
- Update: Maven 3.9.6 + Resolver 1.9.18
- if i use nixos system, how can i install HOT 1
- TerminalOutput.pathToMaven throws StringIndexOutOfBoundsException HOT 5
- Unsupported socket address: ''
- Pick up Maven 3.9.7, OR at least resolver 1.9.19
- Make mvnd Java17 HOT 1
- Make client thin HOT 1
- mvnd happily fails to load extension and continues on
- Mvnd should fail is extension cannot be loaded
- maven-git-versioning-extension extension is not supported
- Split mvnd for Maven 3.x and 4.x support HOT 1
- Hang with SpotBugs plugin and fork=false HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maven-mvnd.