Skip to content

Commit 49627e6

Browse files
Modified getCompileArtifacts() to use reactor to resolve project artifact.
1 parent c8e56a6 commit 49627e6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

japicmp-maven-plugin/src/main/java/japicmp/maven/JApiCmpProcessor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,13 +755,15 @@ private void setUpClassPathUsingMavenProject(final JarArchiveComparatorOptions c
755755
comparatorOptions.getClassPathEntries().addAll(classPathEntries);
756756
}
757757

758-
private Set<Artifact> getCompileArtifacts(final MavenProject mavenProject) {
758+
private Set<Artifact> getCompileArtifacts(final MavenProject mavenProject) throws MojoFailureException {
759759
// dependencies that this project has, including transitive ones
760760
Set<org.apache.maven.artifact.Artifact> projectDependencies =
761761
mavenProject.getArtifacts();
762762

763763
HashSet<Artifact> result = new HashSet<>(1+projectDependencies.size());
764-
result.add(RepositoryUtils.toArtifact(mavenProject.getArtifact())); // include the project artifact
764+
// Include the project artifact; use the reactor to resolve the project artifact in case it's not being built
765+
Artifact project = RepositoryUtils.toArtifact(mavenProject.getArtifact());
766+
result.add(resolveArtifact(project, ConfigurationVersion.NEW));
765767
for (org.apache.maven.artifact.Artifact dep : projectDependencies) {
766768
if (dep.getArtifactHandler().isAddedToClasspath()) {
767769
if (org.apache.maven.artifact.Artifact.SCOPE_COMPILE.equals(dep.getScope())

0 commit comments

Comments
 (0)