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 @@ -96,6 +96,15 @@ tasks.named('publishPlugins') {
96
96
}
97
97
}
98
98
99
+ var rootPath = findProperty(" mavenRootDirectory" )
100
+ jar {
101
+ metaInf {
102
+ from(rootPath, {
103
+ include " LICENSE.txt"
104
+ })
105
+ }
106
+ }
107
+
99
108
publishing {
100
109
publications {
101
110
pluginMaven(MavenPublication ) {
Original file line number Diff line number Diff line change 70
70
<argument >-PprojectVersion=${project.version} </argument >
71
71
<argument >-Ph2Version=${h2.version} </argument >
72
72
<argument >-Dmaven.repo.local=${settings.localRepository} </argument >
73
+ <argument >-PmavenRootDirectory=${rootProject.directory} </argument >
73
74
</arguments >
74
75
</configuration >
75
76
<goals >
122
123
<argument >-PprojectVersion=${project.version} </argument >
123
124
<argument >-Ph2Version=${h2.version} </argument >
124
125
<argument >-Dmaven.repo.local=${settings.localRepository} </argument >
126
+ <argument >-PmavenRootDirectory=${rootProject.directory} </argument >
125
127
<argument >-PmavenStagingDirectory=${local.staging.releases.repo.url} </argument >
126
128
</arguments >
127
129
</configuration >
Original file line number Diff line number Diff line change 152
152
<maven .min.version>${maven.version} </maven .min.version>
153
153
<maven-core .version>${maven.version} </maven-core .version>
154
154
155
+ <!--
156
+ The absolute path to the root project directory.
157
+ This property is set by the build-helper plugin.
158
+ We initialize it to some crude, potentially wrong value,
159
+ because the Sonar Maven plugin uses this property indirectly,
160
+ but ignores any change made by other plugins.
161
+ This default value is the best we can do without the help of a Maven plugin.
162
+
163
+ Useful resources:
164
+ - https://www.mojohaus.org/build-helper-maven-plugin/rootlocation-mojo.html
165
+ -->
166
+ <rootProject .directory>${user.dir} </rootProject .directory>
155
167
</properties >
156
168
157
169
<dependencyManagement >
315
327
</distributionManagement >
316
328
317
329
<build >
330
+ <resources >
331
+ <resource >
332
+ <!-- The default resource dir: -->
333
+ <directory >${project.basedir} /src/main/resources</directory >
334
+ </resource >
335
+ <resource >
336
+ <!-- Extra dir to include the license file: -->
337
+ <directory >${rootProject.directory} </directory >
338
+ <includes >
339
+ <include >LICENSE.txt</include >
340
+ </includes >
341
+ <targetPath >META-INF</targetPath >
342
+ </resource >
343
+ </resources >
318
344
<pluginManagement >
319
345
<plugins >
320
346
<plugin >
386
412
</execution >
387
413
</executions >
388
414
</plugin >
415
+ <plugin >
416
+ <groupId >org.codehaus.mojo</groupId >
417
+ <artifactId >build-helper-maven-plugin</artifactId >
418
+ <executions >
419
+ <execution >
420
+ <id >set-root-location-property</id >
421
+ <goals >
422
+ <goal >rootlocation</goal >
423
+ </goals >
424
+ <configuration >
425
+ <rootLocationProperty >rootProject.directory</rootLocationProperty >
426
+ </configuration >
427
+ </execution >
428
+ </executions >
429
+ </plugin >
389
430
</plugins >
390
431
</build >
391
432
You can’t perform that action at this time.
0 commit comments