File tree Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,15 @@ tasks.named('publishPlugins') {
75
75
}
76
76
}
77
77
78
+ var rootPath = findProperty(" mavenRootDirectory" )
79
+ jar {
80
+ metaInf {
81
+ from(rootPath, {
82
+ include " LICENSE.txt"
83
+ })
84
+ }
85
+ }
86
+
78
87
publishing {
79
88
publications {
80
89
pluginMaven(MavenPublication ) {
Original file line number Diff line number Diff line change 83
83
<arguments >
84
84
<argument >clean</argument >
85
85
<argument >-Pversion=${project.version} </argument >
86
+ <argument >-PmavenRootDirectory=${rootProject.directory} </argument >
86
87
</arguments >
87
88
</configuration >
88
89
<goals >
119
120
<argument >publishPluginMavenPublicationToStagingRepository</argument >
120
121
<argument >-Pversion=${project.version} </argument >
121
122
<argument >-Dmaven.repo.local=${settings.localRepository} </argument >
123
+ <argument >-PmavenRootDirectory=${rootProject.directory} </argument >
122
124
<argument >-PmavenStagingDirectory=${local.staging.releases.repo.url} </argument >
123
125
</arguments >
124
126
</configuration >
Original file line number Diff line number Diff line change 150
150
<maven .min.version>${maven.version} </maven .min.version>
151
151
<maven-core .version>${maven.version} </maven-core .version>
152
152
153
+ <!--
154
+ The absolute path to the root project directory.
155
+ This property is set by the build-helper plugin.
156
+ We initialize it to some crude, potentially wrong value,
157
+ because the Sonar Maven plugin uses this property indirectly,
158
+ but ignores any change made by other plugins.
159
+ This default value is the best we can do without the help of a Maven plugin.
160
+
161
+ Useful resources:
162
+ - https://www.mojohaus.org/build-helper-maven-plugin/rootlocation-mojo.html
163
+ -->
164
+ <rootProject .directory>${user.dir} </rootProject .directory>
153
165
</properties >
154
166
155
167
<dependencyManagement >
298
310
</distributionManagement >
299
311
300
312
<build >
313
+ <resources >
314
+ <resource >
315
+ <!-- The default resource dir: -->
316
+ <directory >${project.basedir} /src/main/resources</directory >
317
+ </resource >
318
+ <resource >
319
+ <!-- Extra dir to include the license file: -->
320
+ <directory >${rootProject.directory} </directory >
321
+ <includes >
322
+ <include >LICENSE.txt</include >
323
+ </includes >
324
+ <targetPath >META-INF</targetPath >
325
+ </resource >
326
+ </resources >
301
327
<pluginManagement >
302
328
<plugins >
303
329
<plugin >
369
395
</execution >
370
396
</executions >
371
397
</plugin >
398
+ <plugin >
399
+ <groupId >org.codehaus.mojo</groupId >
400
+ <artifactId >build-helper-maven-plugin</artifactId >
401
+ <executions >
402
+ <execution >
403
+ <id >set-root-location-property</id >
404
+ <goals >
405
+ <goal >rootlocation</goal >
406
+ </goals >
407
+ <configuration >
408
+ <rootLocationProperty >rootProject.directory</rootLocationProperty >
409
+ </configuration >
410
+ </execution >
411
+ </executions >
412
+ </plugin >
372
413
</plugins >
373
414
</build >
374
415
You can’t perform that action at this time.
0 commit comments