[ODLPARENT-264] Fix thread safety around depends-maven-plugin Created: 29/Sep/21  Updated: 26/Dec/23

Status: Confirmed
Project: odlparent
Component/s: SFT
Affects Version/s: None
Fix Version/s: 14.0.0, 13.0.11

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
is blocked by ODLPARENT-262 SingleFeatureTest needs to be safe to... In Progress
Relates
relates to ODLPARENT-265 Do not declare depends-maven-plugin i... Confirmed
Epic Link: Faster Builds

 Description   

We are getting this splat during parallel -Pq build:

[INFO] -----------< org.opendaylight.odlparent:features-odlparent >------------
[INFO] Building ODL :: odlparent :: features-odlparent 9.0.7-SNAPSHOT   [61/63]
[INFO] ------------------------------[ feature ]-------------------------------
[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project      *
[WARNING] * contains the following plugin(s) that have goals not marked   *
[WARNING] * as @threadSafe to support parallel building.                  *
[WARNING] * While this /may/ work fine, please look for plugin updates    *
[WARNING] * and/or request plugins be made thread-safe.                   *
[WARNING] * If reporting an issue, report it against the plugin in        *
[WARNING] * question, not against maven-core                              *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked @threadSafe in ODL :: odlparent :: features-odlparent:
[WARNING] org.apache.servicemix.tooling:depends-maven-plugin:1.4.0
[WARNING] Enable debug to see more precisely which goals are not marked @threadSafe.
[WARNING] *****************************************************************

Unfortunately https://github.com/apache/servicemix-maven-plugins seems to be quite dead, so we may need to rework the integration completely.



 Comments   
Comment by Robert Varga [ 29/Sep/21 ]

So this affects only SFT, hence may end up being a duplicate of ODLPARENT-262.

Comment by Robert Varga [ 29/Sep/21 ]

It seems all usage of the plugin has to do with launching pax-exam from surefire. Perhaps we should provide a better alternative?

Comment by Ruslan Kashapov [ 16/Aug/23 ]

depends-maven-plugin is only used to determine current version of the SCR feature being preset for SFT.
in code it looks like below (SingleFeatureTest#227)

// Install SCR
features(maven().groupId("org.apache.karaf.features").artifactId("standard").type("xml")
    .classifier("features").versionAsInProject(), "scr"), 

the versionAsInProject() is a pax-exam logic which relies on data from file
target/classes/META-INF/maven/dependencies.properties generated by depends-maven-plugin

in order to rid of dependency on this plugin we just need to provide the version directly
with no invocation of versionAsInProject(). the simple substitution for gaining information about
dependencies could be maven-dependency-plugin:list configured for execution on pre-test stage
(test-compile) with output to a file which then can be parsed by test logic.

this is being proposed as apart of solution for ODLPARENT-257 
see https://git.opendaylight.org/gerrit/c/odlparent/+/106844/3/abstract-feature-parent/pom.xml#87
it makes sense to handle scr feature preset same way as test dependencies

in further perspectives (if SFT is implemented as maven plugin) then dependencies can be handled internally

Comment by Robert Varga [ 10/Sep/23 ]

SFT spawns karaf instances, which may access network ports and similar, hence ODLPARENT-262 will introduce better wiring with maven, e.g. we can resolve these dependencies.

That will render depends-maven-plugin obsolete.

Generated at Wed Feb 07 20:28:04 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.