Skip to content

Commit

Permalink
Merge pull request #664 from apache/OAK-9896-intellij-build-workaround
Browse files Browse the repository at this point in the history
OAK-9896 - Running unit-tests in IntelliJ dos not work
  • Loading branch information
jsedding committed Aug 22, 2022
2 parents 351f2a9 + 74c33cc commit 44155cd
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions oak-parent/pom.xml
Expand Up @@ -1316,5 +1316,37 @@
</pluginManagement>
</build>
</profile>
<profile>
<id>intellij-build-workaround</id>
<!-- workaround for IntelliJ issue https://youtrack.jetbrains.com/issue/IDEA-141732/OSMORC-unable-to-load-bnd-plugin -->
<!-- IntelliJ does not add the plugin's extra dependency to the plugin's class-path, which causes the build to fail. -->
<!-- This means unit-tests cannot be run from within the IDE. Removing the _plugin instruction from the config if -->
<!-- the IntelliJ specific property "idea.maven.embedder.version" is present resolves the issue. In order for all -->
<!-- tests to work properly, a maven build may need to be run first, in order to generate SCR configuration files -->
<!-- from the "old" Felix OSGi annotations. The newer annotations from the OSGi DS specification are supported ootb -->
<!-- by bnd and thus by the maven-bundle-plugin. -->
<activation>
<property>
<name>idea.maven.embedder.version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<_plugin combine.self="override">
<!-- remove the _plugin instruction that causes Intellij IDEA to fail when running unit-tests -->
</_plugin>
</instructions>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>

0 comments on commit 44155cd

Please sign in to comment.