[GitHub] [maven] cstamas commented on a diff in pull request #954: [MNG-7629] Change reactor reader to copy packaged artifacts and reuse them across builds if needed

2023-01-18 Thread GitBox


cstamas commented on code in PR #954:
URL: https://github.com/apache/maven/pull/954#discussion_r1073687908


##
maven-core/src/main/java/org/apache/maven/ReactorReader.java:
##
@@ -324,4 +273,185 @@ private static boolean isTestArtifact(Artifact artifact) {
 return ("test-jar".equals(artifact.getProperty("type", "")))
 || ("jar".equals(artifact.getExtension()) && 
"tests".equals(artifact.getClassifier()));
 }
+
+private File findInProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+return Files.isRegularFile(target) ? target.toFile() : null;
+}
+
+/**
+ * Copy packaged and attached artifacts from this project to the
+ * project local repository.
+ * This allows a subsequent build to resume while still being able
+ * to locate attached artifacts.
+ *
+ * @param project the project to copy artifacts from
+ */
+private void installIntoProjectLocalRepository(MavenProject project) {
+if (!hasBeenPackagedDuringThisSession(project)) {
+return;
+}
+
getProjectArtifacts(project).filter(this::isRegularFile).forEach(this::installIntoProjectLocalRepository);
+}
+
+private void cleanProjectLocalRepository(MavenProject project) {
+try {
+Path artifactPath = getProjectLocalRepo()
+.resolve(project.getGroupId())
+.resolve(project.getArtifactId())
+.resolve(project.getVersion());
+if (Files.isDirectory(artifactPath)) {
+try (Stream paths = Files.list(artifactPath)) {
+for (Path path : (Iterable) paths::iterator) {
+Files.delete(path);
+}
+}
+try {
+Files.delete(artifactPath);
+Files.delete(artifactPath.getParent());
+Files.delete(artifactPath.getParent().getParent());
+} catch (DirectoryNotEmptyException e) {
+// ignore
+}
+}
+} catch (IOException e) {
+LOGGER.error("Error while cleaning project local repository", e);
+}
+}
+
+/**
+ * Retrieve a stream of the project's artifacts
+ */
+private Stream getProjectArtifacts(MavenProject project) {
+Stream artifacts = Stream.concat(
+Stream.concat(
+// pom artifact
+Stream.of(new ProjectArtifact(project)),
+// main project artifact if not a pom
+"pom".equals(project.getPackaging()) ? Stream.empty() 
: Stream.of(project.getArtifact())),
+// attached artifacts
+project.getAttachedArtifacts().stream());
+return artifacts.map(RepositoryUtils::toArtifact);
+}
+
+private boolean isRegularFile(Artifact artifact) {
+return artifact.getFile() != null && artifact.getFile().isFile();
+}
+
+private void installIntoProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+try {
+LOGGER.info("Copying {} to project local repository", artifact);
+Files.createDirectories(target.getParent());
+Files.copy(
+artifact.getFile().toPath(),
+target,
+StandardCopyOption.REPLACE_EXISTING,
+StandardCopyOption.COPY_ATTRIBUTES);
+} catch (IOException e) {
+LOGGER.error("Error while copying artifact to project local 
repository", e);
+}
+}
+
+private Path getArtifactPath(Artifact artifact) {
+String groupId = artifact.getGroupId();
+String artifactId = artifact.getArtifactId();
+String version = artifact.getBaseVersion();
+String classifier = artifact.getClassifier();
+String extension = artifact.getExtension();
+Path repo = getProjectLocalRepo();
+return repo.resolve(groupId)
+.resolve(artifactId)
+.resolve(version)
+.resolve(artifactId
++ "-" + version
++ (classifier != null && !classifier.isEmpty() ? "-" + 
classifier : "")
++ "." + extension);
+}
+
+private Path getProjectLocalRepo() {
+Path root = 
session.getRequest().getMultiModuleProjectDirectory().toPath();

Review Comment:
   Cool, was unaware it is always available... and big :+1:  to solve it in 
generic way



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [maven] cstamas commented on a diff in pull request #954: [MNG-7629] Change reactor reader to copy packaged artifacts and reuse them across builds if needed

2023-01-18 Thread GitBox


cstamas commented on code in PR #954:
URL: https://github.com/apache/maven/pull/954#discussion_r1073675245


##
maven-core/src/main/java/org/apache/maven/ReactorReader.java:
##
@@ -324,4 +273,185 @@ private static boolean isTestArtifact(Artifact artifact) {
 return ("test-jar".equals(artifact.getProperty("type", "")))
 || ("jar".equals(artifact.getExtension()) && 
"tests".equals(artifact.getClassifier()));
 }
+
+private File findInProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+return Files.isRegularFile(target) ? target.toFile() : null;
+}
+
+/**
+ * Copy packaged and attached artifacts from this project to the
+ * project local repository.
+ * This allows a subsequent build to resume while still being able
+ * to locate attached artifacts.
+ *
+ * @param project the project to copy artifacts from
+ */
+private void installIntoProjectLocalRepository(MavenProject project) {
+if (!hasBeenPackagedDuringThisSession(project)) {
+return;
+}
+
getProjectArtifacts(project).filter(this::isRegularFile).forEach(this::installIntoProjectLocalRepository);
+}
+
+private void cleanProjectLocalRepository(MavenProject project) {
+try {
+Path artifactPath = getProjectLocalRepo()
+.resolve(project.getGroupId())
+.resolve(project.getArtifactId())
+.resolve(project.getVersion());
+if (Files.isDirectory(artifactPath)) {
+try (Stream paths = Files.list(artifactPath)) {
+for (Path path : (Iterable) paths::iterator) {
+Files.delete(path);
+}
+}
+try {
+Files.delete(artifactPath);
+Files.delete(artifactPath.getParent());
+Files.delete(artifactPath.getParent().getParent());
+} catch (DirectoryNotEmptyException e) {
+// ignore
+}
+}
+} catch (IOException e) {
+LOGGER.error("Error while cleaning project local repository", e);
+}
+}
+
+/**
+ * Retrieve a stream of the project's artifacts
+ */
+private Stream getProjectArtifacts(MavenProject project) {
+Stream artifacts = Stream.concat(
+Stream.concat(
+// pom artifact
+Stream.of(new ProjectArtifact(project)),
+// main project artifact if not a pom
+"pom".equals(project.getPackaging()) ? Stream.empty() 
: Stream.of(project.getArtifact())),
+// attached artifacts
+project.getAttachedArtifacts().stream());
+return artifacts.map(RepositoryUtils::toArtifact);
+}
+
+private boolean isRegularFile(Artifact artifact) {
+return artifact.getFile() != null && artifact.getFile().isFile();
+}
+
+private void installIntoProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+try {
+LOGGER.info("Copying {} to project local repository", artifact);
+Files.createDirectories(target.getParent());
+Files.copy(
+artifact.getFile().toPath(),
+target,
+StandardCopyOption.REPLACE_EXISTING,
+StandardCopyOption.COPY_ATTRIBUTES);
+} catch (IOException e) {
+LOGGER.error("Error while copying artifact to project local 
repository", e);
+}
+}
+
+private Path getArtifactPath(Artifact artifact) {
+String groupId = artifact.getGroupId();
+String artifactId = artifact.getArtifactId();
+String version = artifact.getBaseVersion();
+String classifier = artifact.getClassifier();
+String extension = artifact.getExtension();
+Path repo = getProjectLocalRepo();
+return repo.resolve(groupId)
+.resolve(artifactId)
+.resolve(version)
+.resolve(artifactId
++ "-" + version
++ (classifier != null && !classifier.isEmpty() ? "-" + 
classifier : "")
++ "." + extension);
+}
+
+private Path getProjectLocalRepo() {
+Path root = 
session.getRequest().getMultiModuleProjectDirectory().toPath();
+return root.resolve("target").resolve("project-local-repo");

Review Comment:
   Default is in super POM 
https://github.com/apache/maven/blob/20f7c65a520ee4c6a5dde0de4d58e304b1bde442/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml#L54



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific 

[GitHub] [maven] cstamas commented on a diff in pull request #954: [MNG-7629] Change reactor reader to copy packaged artifacts and reuse them across builds if needed

2023-01-18 Thread GitBox


cstamas commented on code in PR #954:
URL: https://github.com/apache/maven/pull/954#discussion_r1073670208


##
maven-core/src/main/java/org/apache/maven/ReactorReader.java:
##
@@ -324,4 +273,185 @@ private static boolean isTestArtifact(Artifact artifact) {
 return ("test-jar".equals(artifact.getProperty("type", "")))
 || ("jar".equals(artifact.getExtension()) && 
"tests".equals(artifact.getClassifier()));
 }
+
+private File findInProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+return Files.isRegularFile(target) ? target.toFile() : null;
+}
+
+/**
+ * Copy packaged and attached artifacts from this project to the
+ * project local repository.
+ * This allows a subsequent build to resume while still being able
+ * to locate attached artifacts.
+ *
+ * @param project the project to copy artifacts from
+ */
+private void installIntoProjectLocalRepository(MavenProject project) {
+if (!hasBeenPackagedDuringThisSession(project)) {
+return;
+}
+
getProjectArtifacts(project).filter(this::isRegularFile).forEach(this::installIntoProjectLocalRepository);
+}
+
+private void cleanProjectLocalRepository(MavenProject project) {
+try {
+Path artifactPath = getProjectLocalRepo()
+.resolve(project.getGroupId())
+.resolve(project.getArtifactId())
+.resolve(project.getVersion());
+if (Files.isDirectory(artifactPath)) {
+try (Stream paths = Files.list(artifactPath)) {
+for (Path path : (Iterable) paths::iterator) {
+Files.delete(path);
+}
+}
+try {
+Files.delete(artifactPath);
+Files.delete(artifactPath.getParent());
+Files.delete(artifactPath.getParent().getParent());
+} catch (DirectoryNotEmptyException e) {
+// ignore
+}
+}
+} catch (IOException e) {
+LOGGER.error("Error while cleaning project local repository", e);
+}
+}
+
+/**
+ * Retrieve a stream of the project's artifacts
+ */
+private Stream getProjectArtifacts(MavenProject project) {
+Stream artifacts = Stream.concat(
+Stream.concat(
+// pom artifact
+Stream.of(new ProjectArtifact(project)),
+// main project artifact if not a pom
+"pom".equals(project.getPackaging()) ? Stream.empty() 
: Stream.of(project.getArtifact())),
+// attached artifacts
+project.getAttachedArtifacts().stream());
+return artifacts.map(RepositoryUtils::toArtifact);
+}
+
+private boolean isRegularFile(Artifact artifact) {
+return artifact.getFile() != null && artifact.getFile().isFile();
+}
+
+private void installIntoProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+try {
+LOGGER.info("Copying {} to project local repository", artifact);
+Files.createDirectories(target.getParent());
+Files.copy(
+artifact.getFile().toPath(),
+target,
+StandardCopyOption.REPLACE_EXISTING,
+StandardCopyOption.COPY_ATTRIBUTES);
+} catch (IOException e) {
+LOGGER.error("Error while copying artifact to project local 
repository", e);
+}
+}
+
+private Path getArtifactPath(Artifact artifact) {
+String groupId = artifact.getGroupId();
+String artifactId = artifact.getArtifactId();
+String version = artifact.getBaseVersion();
+String classifier = artifact.getClassifier();
+String extension = artifact.getExtension();
+Path repo = getProjectLocalRepo();
+return repo.resolve(groupId)
+.resolve(artifactId)
+.resolve(version)
+.resolve(artifactId
++ "-" + version
++ (classifier != null && !classifier.isEmpty() ? "-" + 
classifier : "")
++ "." + extension);
+}
+
+private Path getProjectLocalRepo() {
+Path root = 
session.getRequest().getMultiModuleProjectDirectory().toPath();
+return root.resolve("target").resolve("project-local-repo");

Review Comment:
   https://maven.apache.org/pom.html#Build



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:

[GitHub] [maven] cstamas commented on a diff in pull request #954: [MNG-7629] Change reactor reader to copy packaged artifacts and reuse them across builds if needed

2023-01-18 Thread GitBox


cstamas commented on code in PR #954:
URL: https://github.com/apache/maven/pull/954#discussion_r1073658196


##
maven-core/src/main/java/org/apache/maven/ReactorReader.java:
##
@@ -324,4 +273,185 @@ private static boolean isTestArtifact(Artifact artifact) {
 return ("test-jar".equals(artifact.getProperty("type", "")))
 || ("jar".equals(artifact.getExtension()) && 
"tests".equals(artifact.getClassifier()));
 }
+
+private File findInProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+return Files.isRegularFile(target) ? target.toFile() : null;
+}
+
+/**
+ * Copy packaged and attached artifacts from this project to the
+ * project local repository.
+ * This allows a subsequent build to resume while still being able
+ * to locate attached artifacts.
+ *
+ * @param project the project to copy artifacts from
+ */
+private void installIntoProjectLocalRepository(MavenProject project) {
+if (!hasBeenPackagedDuringThisSession(project)) {
+return;
+}
+
getProjectArtifacts(project).filter(this::isRegularFile).forEach(this::installIntoProjectLocalRepository);
+}
+
+private void cleanProjectLocalRepository(MavenProject project) {
+try {
+Path artifactPath = getProjectLocalRepo()
+.resolve(project.getGroupId())
+.resolve(project.getArtifactId())
+.resolve(project.getVersion());
+if (Files.isDirectory(artifactPath)) {
+try (Stream paths = Files.list(artifactPath)) {
+for (Path path : (Iterable) paths::iterator) {
+Files.delete(path);
+}
+}
+try {
+Files.delete(artifactPath);
+Files.delete(artifactPath.getParent());
+Files.delete(artifactPath.getParent().getParent());
+} catch (DirectoryNotEmptyException e) {
+// ignore
+}
+}
+} catch (IOException e) {
+LOGGER.error("Error while cleaning project local repository", e);
+}
+}
+
+/**
+ * Retrieve a stream of the project's artifacts
+ */
+private Stream getProjectArtifacts(MavenProject project) {
+Stream artifacts = Stream.concat(
+Stream.concat(
+// pom artifact
+Stream.of(new ProjectArtifact(project)),
+// main project artifact if not a pom
+"pom".equals(project.getPackaging()) ? Stream.empty() 
: Stream.of(project.getArtifact())),
+// attached artifacts
+project.getAttachedArtifacts().stream());
+return artifacts.map(RepositoryUtils::toArtifact);
+}
+
+private boolean isRegularFile(Artifact artifact) {
+return artifact.getFile() != null && artifact.getFile().isFile();
+}
+
+private void installIntoProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+try {
+LOGGER.info("Copying {} to project local repository", artifact);
+Files.createDirectories(target.getParent());
+Files.copy(
+artifact.getFile().toPath(),
+target,
+StandardCopyOption.REPLACE_EXISTING,
+StandardCopyOption.COPY_ATTRIBUTES);
+} catch (IOException e) {
+LOGGER.error("Error while copying artifact to project local 
repository", e);
+}
+}
+
+private Path getArtifactPath(Artifact artifact) {
+String groupId = artifact.getGroupId();
+String artifactId = artifact.getArtifactId();
+String version = artifact.getBaseVersion();
+String classifier = artifact.getClassifier();
+String extension = artifact.getExtension();
+Path repo = getProjectLocalRepo();
+return repo.resolve(groupId)
+.resolve(artifactId)
+.resolve(version)
+.resolve(artifactId
++ "-" + version
++ (classifier != null && !classifier.isEmpty() ? "-" + 
classifier : "")
++ "." + extension);
+}
+
+private Path getProjectLocalRepo() {
+Path root = 
session.getRequest().getMultiModuleProjectDirectory().toPath();

Review Comment:
   Also, the use of `session.getRequest().getMultiModuleProjectDirectory()` 
implies existence of top level `.mvn`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:

[GitHub] [maven] cstamas commented on a diff in pull request #954: [MNG-7629] Change reactor reader to copy packaged artifacts and reuse them across builds if needed

2023-01-18 Thread GitBox


cstamas commented on code in PR #954:
URL: https://github.com/apache/maven/pull/954#discussion_r1073654940


##
maven-core/src/main/java/org/apache/maven/ReactorReader.java:
##
@@ -324,4 +273,185 @@ private static boolean isTestArtifact(Artifact artifact) {
 return ("test-jar".equals(artifact.getProperty("type", "")))
 || ("jar".equals(artifact.getExtension()) && 
"tests".equals(artifact.getClassifier()));
 }
+
+private File findInProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+return Files.isRegularFile(target) ? target.toFile() : null;
+}
+
+/**
+ * Copy packaged and attached artifacts from this project to the
+ * project local repository.
+ * This allows a subsequent build to resume while still being able
+ * to locate attached artifacts.
+ *
+ * @param project the project to copy artifacts from
+ */
+private void installIntoProjectLocalRepository(MavenProject project) {
+if (!hasBeenPackagedDuringThisSession(project)) {
+return;
+}
+
getProjectArtifacts(project).filter(this::isRegularFile).forEach(this::installIntoProjectLocalRepository);
+}
+
+private void cleanProjectLocalRepository(MavenProject project) {
+try {
+Path artifactPath = getProjectLocalRepo()
+.resolve(project.getGroupId())
+.resolve(project.getArtifactId())
+.resolve(project.getVersion());
+if (Files.isDirectory(artifactPath)) {
+try (Stream paths = Files.list(artifactPath)) {
+for (Path path : (Iterable) paths::iterator) {
+Files.delete(path);
+}
+}
+try {
+Files.delete(artifactPath);
+Files.delete(artifactPath.getParent());
+Files.delete(artifactPath.getParent().getParent());
+} catch (DirectoryNotEmptyException e) {
+// ignore
+}
+}
+} catch (IOException e) {
+LOGGER.error("Error while cleaning project local repository", e);
+}
+}
+
+/**
+ * Retrieve a stream of the project's artifacts
+ */
+private Stream getProjectArtifacts(MavenProject project) {
+Stream artifacts = Stream.concat(
+Stream.concat(
+// pom artifact
+Stream.of(new ProjectArtifact(project)),
+// main project artifact if not a pom
+"pom".equals(project.getPackaging()) ? Stream.empty() 
: Stream.of(project.getArtifact())),
+// attached artifacts
+project.getAttachedArtifacts().stream());
+return artifacts.map(RepositoryUtils::toArtifact);
+}
+
+private boolean isRegularFile(Artifact artifact) {
+return artifact.getFile() != null && artifact.getFile().isFile();
+}
+
+private void installIntoProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+try {
+LOGGER.info("Copying {} to project local repository", artifact);
+Files.createDirectories(target.getParent());
+Files.copy(
+artifact.getFile().toPath(),
+target,
+StandardCopyOption.REPLACE_EXISTING,
+StandardCopyOption.COPY_ATTRIBUTES);
+} catch (IOException e) {
+LOGGER.error("Error while copying artifact to project local 
repository", e);
+}
+}
+
+private Path getArtifactPath(Artifact artifact) {
+String groupId = artifact.getGroupId();
+String artifactId = artifact.getArtifactId();
+String version = artifact.getBaseVersion();
+String classifier = artifact.getClassifier();
+String extension = artifact.getExtension();
+Path repo = getProjectLocalRepo();
+return repo.resolve(groupId)
+.resolve(artifactId)
+.resolve(version)
+.resolve(artifactId
++ "-" + version
++ (classifier != null && !classifier.isEmpty() ? "-" + 
classifier : "")
++ "." + extension);
+}
+
+private Path getProjectLocalRepo() {
+Path root = 
session.getRequest().getMultiModuleProjectDirectory().toPath();
+return root.resolve("target").resolve("project-local-repo");

Review Comment:
   um, `target` is hardcoded?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


[GitHub] [maven] cstamas commented on a diff in pull request #954: [MNG-7629] Change reactor reader to copy packaged artifacts and reuse them across builds if needed

2023-01-18 Thread GitBox


cstamas commented on code in PR #954:
URL: https://github.com/apache/maven/pull/954#discussion_r1073654940


##
maven-core/src/main/java/org/apache/maven/ReactorReader.java:
##
@@ -324,4 +273,185 @@ private static boolean isTestArtifact(Artifact artifact) {
 return ("test-jar".equals(artifact.getProperty("type", "")))
 || ("jar".equals(artifact.getExtension()) && 
"tests".equals(artifact.getClassifier()));
 }
+
+private File findInProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+return Files.isRegularFile(target) ? target.toFile() : null;
+}
+
+/**
+ * Copy packaged and attached artifacts from this project to the
+ * project local repository.
+ * This allows a subsequent build to resume while still being able
+ * to locate attached artifacts.
+ *
+ * @param project the project to copy artifacts from
+ */
+private void installIntoProjectLocalRepository(MavenProject project) {
+if (!hasBeenPackagedDuringThisSession(project)) {
+return;
+}
+
getProjectArtifacts(project).filter(this::isRegularFile).forEach(this::installIntoProjectLocalRepository);
+}
+
+private void cleanProjectLocalRepository(MavenProject project) {
+try {
+Path artifactPath = getProjectLocalRepo()
+.resolve(project.getGroupId())
+.resolve(project.getArtifactId())
+.resolve(project.getVersion());
+if (Files.isDirectory(artifactPath)) {
+try (Stream paths = Files.list(artifactPath)) {
+for (Path path : (Iterable) paths::iterator) {
+Files.delete(path);
+}
+}
+try {
+Files.delete(artifactPath);
+Files.delete(artifactPath.getParent());
+Files.delete(artifactPath.getParent().getParent());
+} catch (DirectoryNotEmptyException e) {
+// ignore
+}
+}
+} catch (IOException e) {
+LOGGER.error("Error while cleaning project local repository", e);
+}
+}
+
+/**
+ * Retrieve a stream of the project's artifacts
+ */
+private Stream getProjectArtifacts(MavenProject project) {
+Stream artifacts = Stream.concat(
+Stream.concat(
+// pom artifact
+Stream.of(new ProjectArtifact(project)),
+// main project artifact if not a pom
+"pom".equals(project.getPackaging()) ? Stream.empty() 
: Stream.of(project.getArtifact())),
+// attached artifacts
+project.getAttachedArtifacts().stream());
+return artifacts.map(RepositoryUtils::toArtifact);
+}
+
+private boolean isRegularFile(Artifact artifact) {
+return artifact.getFile() != null && artifact.getFile().isFile();
+}
+
+private void installIntoProjectLocalRepository(Artifact artifact) {
+Path target = getArtifactPath(artifact);
+try {
+LOGGER.info("Copying {} to project local repository", artifact);
+Files.createDirectories(target.getParent());
+Files.copy(
+artifact.getFile().toPath(),
+target,
+StandardCopyOption.REPLACE_EXISTING,
+StandardCopyOption.COPY_ATTRIBUTES);
+} catch (IOException e) {
+LOGGER.error("Error while copying artifact to project local 
repository", e);
+}
+}
+
+private Path getArtifactPath(Artifact artifact) {
+String groupId = artifact.getGroupId();
+String artifactId = artifact.getArtifactId();
+String version = artifact.getBaseVersion();
+String classifier = artifact.getClassifier();
+String extension = artifact.getExtension();
+Path repo = getProjectLocalRepo();
+return repo.resolve(groupId)
+.resolve(artifactId)
+.resolve(version)
+.resolve(artifactId
++ "-" + version
++ (classifier != null && !classifier.isEmpty() ? "-" + 
classifier : "")
++ "." + extension);
+}
+
+private Path getProjectLocalRepo() {
+Path root = 
session.getRequest().getMultiModuleProjectDirectory().toPath();
+return root.resolve("target").resolve("project-local-repo");

Review Comment:
   um, this is hardcoded?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org