ninja-maven-plugin/src/main/java/ninja/maven/NinjaRunMojo.java
protected List<Artifact> getAllArtifactsComingFromNinjaStandalone(
        List<Artifact> artifacts) {
    
        List<Artifact> resultingArtifacts = new ArrayList<>();
        
        for (Artifact artifact: artifacts) {
        
            for (String dependencyTrail: artifact.getDependencyTrail()) {
            
                // something like:  org.ninjaframework:ninja-standalone:jar:2.5.2
                if (dependencyTrail.contains(NinjaMavenPluginConstants.NINJA_STANDALONE_ARTIFACT_ID)) {
                
                    resultingArtifacts.add(artifact);
                    break;
                
                }
                
            }
        
        }

        return resultingArtifacts;
    
    }
protected List<Artifact> getAllArtifactsComingFromNinjaStandalone(
        List<Artifact> artifacts) {
    
        List<Artifact> resultingArtifacts = new ArrayList<>();
        
        for (Artifact artifact: artifacts) {
        
            for (String dependencyTrail: artifact.getDependencyTrail()) {
            
                // something like:  org.ninjaframework:ninja-standalone:jar:2.5.2
                if (dependencyTrail.contains(NinjaMavenPluginConstants.NINJA_STANDALONE_ARTIFACT_ID)) {
                
                    resultingArtifacts.add(artifact);
                    break;
                
                }
                
            }
        
        }

        return resultingArtifacts;
    
    }
protected List < Artifact > getAllArtifactsComingFromNinjaStandalone ( List < Artifact > artifacts ) { List < Artifact > resultingArtifacts = new ArrayList <> ( ) ; for ( Artifact artifact : artifacts ) { for ( String dependencyTrail : artifact . getDependencyTrail ( ) ) { // something like:  org.ninjaframework:ninja-standalone:jar:2.5.2 if ( dependencyTrail . contains ( NinjaMavenPluginConstants . NINJA_STANDALONE_ARTIFACT_ID ) ) { resultingArtifacts . add ( artifact ) ; break ; } } } return resultingArtifacts ; }
This might be a bit hacky. But just a little bit.

We have to add ninja-standalone and all of its dependencies to
the classpath, so that NinjaJetty can start.

But we do not want the user to declare the dependencies inside his
project pom.xml.

Therefore we declare the dependency in this plugin pom.xml.
But we do not want to include all of this plugin's dependencies in the
classpath for NinjaJetty. Therefore this method filters everything and
only adds  dependencies (also transitive deps) that originate
from ninja-standalone. That way we get all deps we need.

@param artifacts A list of artifacts that will be filtered.
@return All artifacts coming from artifactId "ninja-standalone"
(including transitive dependencies)
This might be a bit hacky . But just a little bit .