Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions gradle/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ tasks.named('publishPlugins') {
}
}

var rootPath = findProperty("mavenRootDirectory")
jar {
metaInf {
from(rootPath, {
include "LICENSE.txt"
})
}
}

publishing {
publications {
pluginMaven(MavenPublication) {
Expand Down
2 changes: 2 additions & 0 deletions gradle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<argument>-PprojectVersion=${project.version}</argument>
<argument>-Ph2Version=${h2.version}</argument>
<argument>-Dmaven.repo.local=${settings.localRepository}</argument>
<argument>-PmavenRootDirectory=${rootProject.directory}</argument>
</arguments>
</configuration>
<goals>
Expand Down Expand Up @@ -122,6 +123,7 @@
<argument>-PprojectVersion=${project.version}</argument>
<argument>-Ph2Version=${h2.version}</argument>
<argument>-Dmaven.repo.local=${settings.localRepository}</argument>
<argument>-PmavenRootDirectory=${rootProject.directory}</argument>
<argument>-PmavenStagingDirectory=${local.staging.releases.repo.url}</argument>
</arguments>
</configuration>
Expand Down
41 changes: 41 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,18 @@
<maven.min.version>${maven.version}</maven.min.version>
<maven-core.version>${maven.version}</maven-core.version>

<!--
The absolute path to the root project directory.
This property is set by the build-helper plugin.
We initialize it to some crude, potentially wrong value,
because the Sonar Maven plugin uses this property indirectly,
but ignores any change made by other plugins.
This default value is the best we can do without the help of a Maven plugin.

Useful resources:
- https://www.mojohaus.org/build-helper-maven-plugin/rootlocation-mojo.html
-->
<rootProject.directory>${user.dir}</rootProject.directory>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -315,6 +327,20 @@
</distributionManagement>

<build>
<resources>
<resource>
<!-- The default resource dir: -->
<directory>${project.basedir}/src/main/resources</directory>
</resource>
<resource>
<!-- Extra dir to include the license file: -->
<directory>${rootProject.directory}</directory>
<includes>
<include>LICENSE.txt</include>
</includes>
<targetPath>META-INF</targetPath>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
Expand Down Expand Up @@ -386,6 +412,21 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>set-root-location-property</id>
<goals>
<goal>rootlocation</goal>
</goals>
<configuration>
<rootLocationProperty>rootProject.directory</rootLocationProperty>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down