-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce parameter to control the skipper benavior
- Loading branch information
1 parent
97cea5d
commit f4e6ebc
Showing
7 changed files
with
271 additions
and
82 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DependencyResolutionSkipper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.eclipse.aether.impl; | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import org.eclipse.aether.graph.DependencyNode; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* A skipper that determines whether to skip resolving given node during the dependency collection. | ||
* | ||
* @noimplement This interface is not intended to be implemented by clients. | ||
* @noextend This interface is not intended to be extended by clients. | ||
* @provisional This type is provisional and can be changed, moved or removed without prior notice. | ||
*/ | ||
public interface DependencyResolutionSkipper | ||
{ | ||
/** | ||
* Check whether the resolution of current node can be skipped before resolving. | ||
* | ||
* @param node Current node | ||
* @param parents All parent nodes of current node | ||
* @return | ||
*/ | ||
boolean skipResolution( DependencyNode node, List<DependencyNode> parents ); | ||
|
||
/** | ||
* Cache the resolution result when a node is resolved by @See DependencyCollector after resolution. | ||
* | ||
* @param node Current node | ||
* @param parents All parent nodes of current node | ||
*/ | ||
void cache( DependencyNode node, List<DependencyNode> parents ); | ||
|
||
/** | ||
* Print the skip/resolve status report for all nodes. | ||
*/ | ||
void report(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
.../main/java/org/eclipse/aether/internal/impl/collect/NeverDependencyResolutionSkipper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.eclipse.aether.internal.impl.collect; | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import org.eclipse.aether.graph.DependencyNode; | ||
import org.eclipse.aether.impl.DependencyResolutionSkipper; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Skipper for Non-skip approach. | ||
*/ | ||
final class NeverDependencyResolutionSkipper implements DependencyResolutionSkipper | ||
{ | ||
static final DependencyResolutionSkipper INSTANCE = new NeverDependencyResolutionSkipper(); | ||
|
||
@Override | ||
public boolean skipResolution( DependencyNode node, List<DependencyNode> parents ) | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public void cache( DependencyNode node, List<DependencyNode> parents ) | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public void report() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.