File tree 2 files changed +9
-16
lines changed
main/java/org/apache/maven/plugins/dependency/resolvers
2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change 5
5
# to you under the Apache License, Version 2.0 (the
6
6
# "License"); you may not use this file except in compliance
7
7
# with the License. You may obtain a copy of the License at
8
- #
8
+ #
9
9
# http://www.apache.org/licenses/LICENSE-2.0
10
- #
10
+ #
11
11
# Unless required by applicable law or agreed to in writing,
12
12
# software distributed under the License is distributed on an
13
13
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
16
# under the License.
17
17
18
18
outputFile = target/resolved.txt
19
+ # This is intentional to prove that no classifier is passed (read-only value)
20
+ classifier = foo
Original file line number Diff line number Diff line change 18
18
*/
19
19
package org .apache .maven .plugins .dependency .resolvers ;
20
20
21
- import org .apache .maven .plugin .MojoExecutionException ;
22
21
import org .apache .maven .plugins .annotations .LifecyclePhase ;
23
22
import org .apache .maven .plugins .annotations .Mojo ;
23
+ import org .apache .maven .plugins .annotations .Parameter ;
24
24
import org .apache .maven .plugins .annotations .ResolutionScope ;
25
25
26
26
/**
36
36
threadSafe = true )
37
37
public class ResolveDependencySourcesMojo extends ResolveDependenciesMojo {
38
38
39
- private static final String SOURCE_CLASSIFIER = "sources" ;
39
+ private static final String SOURCES_CLASSIFIER = "sources" ;
40
40
41
- /**
42
- * Main entry into mojo. Gets the list of dependencies and iterates through resolving the source jars.
43
- *
44
- * @throws MojoExecutionException with a message if an error occurs.
45
- */
46
- @ Override
47
- protected void doExecute () throws MojoExecutionException {
48
- if (this .classifier == null || this .classifier .isEmpty ()) {
49
- this .classifier = SOURCE_CLASSIFIER ;
50
- }
51
-
52
- super .doExecute ();
41
+ @ Parameter (name = "classifier" , defaultValue = SOURCES_CLASSIFIER , readonly = true )
42
+ public void setClassifier (String classifier ) {
43
+ this .classifier = classifier ;
53
44
}
54
45
}
You can’t perform that action at this time.
0 commit comments