File tree Expand file tree Collapse file tree 2 files changed +19
-17
lines changed
gradle/plugins/conventions-plugin/src/main/java/org/springframework/ws/gradle/conventions Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change 3030class JavaBasePluginConventions {
3131
3232 void apply (Project project ) {
33+ configureRepositories (project );
3334 project .getTasks ().withType (Javadoc .class ).configureEach ((javadoc ) -> {
3435 MinimalJavadocOptions options = javadoc .getOptions ();
3536 options .quiet ();
@@ -40,4 +41,21 @@ void apply(Project project) {
4041 });
4142 }
4243
44+ private void configureRepositories (Project project ) {
45+ project .getRepositories ().mavenCentral ();
46+ String version = project .getVersion ().toString ();
47+ if (version .contains ("-" )) {
48+ project .getRepositories ().maven ((repository ) -> {
49+ repository .setName ("Spring Milestones" );
50+ repository .setUrl ("https://repo.spring.io/milestone" );
51+ });
52+ }
53+ if (version .endsWith ("-SNAPSHOT" )) {
54+ project .getRepositories ().maven ((repository ) -> {
55+ repository .setName ("Spring Snapshots" );
56+ repository .setUrl ("https://repo.spring.io/snapshot" );
57+ });
58+ }
59+ }
60+
4361}
Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ class JavaPluginConventions {
4343 void apply (Project project ) {
4444 project .getPlugins ().apply (SpringJavaFormatPlugin .class );
4545 JavaPluginExtension java = project .getExtensions ().getByType (JavaPluginExtension .class );
46- configureRepositories (project );
4746 enableSourceAndJavadocJars (java );
4847 configureSourceAndTargetCompatibility (java );
4948 configureDependencyManagement (project );
@@ -53,22 +52,7 @@ void apply(Project project) {
5352 configureJUnitPlatform (project );
5453 }
5554
56- private void configureRepositories (Project project ) {
57- project .getRepositories ().mavenCentral ();
58- String version = project .getVersion ().toString ();
59- if (version .contains ("-" )) {
60- project .getRepositories ().maven ((repository ) -> {
61- repository .setName ("Spring Milestones" );
62- repository .setUrl ("https://repo.spring.io/milestone" );
63- });
64- }
65- if (version .endsWith ("-SNAPSHOT" )) {
66- project .getRepositories ().maven ((repository ) -> {
67- repository .setName ("Spring Snapshots" );
68- repository .setUrl ("https://repo.spring.io/snapshot" );
69- });
70- }
71- }
55+
7256
7357 private void enableSourceAndJavadocJars (JavaPluginExtension java ) {
7458 java .withSourcesJar ();
You can’t perform that action at this time.
0 commit comments