File tree Expand file tree Collapse file tree 2 files changed +9
-16
lines changed
main/java/org/apache/maven/plugins/dependency/resolvers Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change 55# to you under the Apache License, Version 2.0 (the
66# "License"); you may not use this file except in compliance
77# with the License. You may obtain a copy of the License at
8- #
8+ #
99# http://www.apache.org/licenses/LICENSE-2.0
10- #
10+ #
1111# Unless required by applicable law or agreed to in writing,
1212# software distributed under the License is distributed on an
1313# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1616# under the License.
1717
1818outputFile = 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 1818 */
1919package org .apache .maven .plugins .dependency .resolvers ;
2020
21- import org .apache .maven .plugin .MojoExecutionException ;
2221import org .apache .maven .plugins .annotations .LifecyclePhase ;
2322import org .apache .maven .plugins .annotations .Mojo ;
23+ import org .apache .maven .plugins .annotations .Parameter ;
2424import org .apache .maven .plugins .annotations .ResolutionScope ;
2525
2626/**
3636 threadSafe = true )
3737public class ResolveDependencySourcesMojo extends ResolveDependenciesMojo {
3838
39- private static final String SOURCE_CLASSIFIER = "sources" ;
39+ private static final String SOURCES_CLASSIFIER = "sources" ;
4040
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 ;
5344 }
5445}
You can’t perform that action at this time.
0 commit comments