Skip to content

Commit

Permalink
Merge pull request #23035 from aloubyansky/set-current-project-dir-bo…
Browse files Browse the repository at this point in the history
…otstrap-provider

Set current project file when initializing the Maven resolver in the bootstrap provider
  • Loading branch information
aloubyansky authored Jan 21, 2022
2 parents 2040416 + 1c177ac commit 74b8d3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,9 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {
.setRepositorySystem(repoSystem)
.setRemoteRepositories(repos)
.setRemoteRepositoryManager(remoteRepositoryManager)
.setWorkspaceDiscovery(true);
.setWorkspaceDiscovery(true)
.setPreferPomsFromWorkspace(true)
.setCurrentProject(project.getFile().toString());

// if it already exists, it may be a reload triggered by a change in a POM
// in which case we should not be using the original Maven session
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ private MavenArtifactResolver artifactResolver(QuarkusBootstrapMojo mojo, Launch
try {
return MavenArtifactResolver.builder()
.setWorkspaceDiscovery(mode == LaunchMode.DEVELOPMENT || mode == LaunchMode.TEST)
.setCurrentProject(mojo.mavenProject().getFile().toString())
.setPreferPomsFromWorkspace(mode == LaunchMode.DEVELOPMENT || mode == LaunchMode.TEST)
.setRepositorySystem(repoSystem)
.setRepositorySystemSession(mojo.repositorySystemSession())
Expand Down

0 comments on commit 74b8d3b

Please sign in to comment.