Skip to content

Commit 4db8ead

Browse files
committed
[MDEP-941] Deprecate dependency:sources in favor of dependency:resolve-sources
This closes #411
1 parent 04c3216 commit 4db8ead

File tree

5 files changed

+53
-6
lines changed

5 files changed

+53
-6
lines changed

src/it/projects/sources/invoker.properties renamed to src/it/projects/resolve-sources/invoker.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
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
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:sources
18+
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:resolve-sources

src/it/projects/sources/pom.xml renamed to src/it/projects/resolve-sources/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<name>Test</name>
3131
<description>
32-
Test dependency:sources
32+
Test dependency:resolve-sources
3333
</description>
3434

3535
<properties>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.maven.plugins.dependency.resolvers;
20+
21+
import org.apache.maven.plugin.MojoExecutionException;
22+
import org.apache.maven.plugins.annotations.LifecyclePhase;
23+
import org.apache.maven.plugins.annotations.Mojo;
24+
import org.apache.maven.plugins.annotations.ResolutionScope;
25+
26+
/**
27+
* Goal that resolves the project source dependencies from the repository.
28+
*
29+
* @author <a href="mailto:[email protected]">Brian Fox</a>
30+
* @since 2.0-alpha2
31+
* @deprecated in favor of {@code resolve-sources} mojo
32+
*/
33+
@Mojo(
34+
name = "sources",
35+
defaultPhase = LifecyclePhase.GENERATE_SOURCES,
36+
requiresDependencyResolution = ResolutionScope.TEST,
37+
threadSafe = true)
38+
@Deprecated
39+
public class OldResolveDependencySourcesMojo extends ResolveDependencySourcesMojo {
40+
41+
@Override
42+
protected void doExecute() throws MojoExecutionException {
43+
getLog().warn(
44+
"The goal 'dependency:sources' is deprecated for removal in a future version of this plugin, please use 'dependency:resolve-sources' instead");
45+
super.doExecute();
46+
}
47+
}

src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
* Goal that resolves the project source dependencies from the repository.
2828
*
2929
* @author <a href="mailto:[email protected]">Brian Fox</a>
30-
* @since 2.0-alpha2
30+
* @since 2.0-alpha2/3.7.0
3131
*/
3232
@Mojo(
33-
name = "sources",
33+
name = "resolve-sources",
3434
defaultPhase = LifecyclePhase.GENERATE_SOURCES,
3535
requiresDependencyResolution = ResolutionScope.TEST,
3636
threadSafe = true)

0 commit comments

Comments
 (0)