add "gcube-default" profile as default profile.

This commit is contained in:
Roberto Cirillo 2022-02-21 14:12:00 +01:00
parent 44c0025860
commit aab964c1a8
1 changed files with 127 additions and 2 deletions

127
pom.xml
View File

@ -105,11 +105,136 @@
<profile>
<id>gcube-developer</id>
<id>gcube-default</id>
<activation>
<!-- This profile will automatically be active for all builds unless another profile in the POM is activated -->
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- This profile sets an additional parameter for javadoc generation to disables the doclint.
It avoids the build fails if formal/syntax errors are found in javadoc comments.
The parameter is only understood by jdk 1.8, so we set it only when jdk 1.8 is used -->
<javadoc.opts>-Xdoclint:none</javadoc.opts>
<java_version>1.8</java_version>
<maven.compiler.source>${java_version}</maven.compiler.source>
<maven.compiler.target>${java_version}</maven.compiler.target>
</properties>
<!-- Repositories for dependency resolution -->
<repositories>
<repository>
<id>gcube-snapshots</id>
<name>gCube Snapshots</name>
<url>${repository.snapshots.url}</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>gcube-releases</id>
<name>gCube Releases</name>
<url>${repository.releases.url}</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>gcube-externals</id>
<name>gCube Externals</name>
<url>${repository.externals.readonly}</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<!-- Repositories for deployments -->
<distributionManagement>
<repository>
<id>gcube-snapshots</id>
<name>gCube Snapshots</name>
<url>${repository.snapshots.url}</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${plugin.build.helper.version}</version>
<executions>
<execution>
<!-- sets the skip.when.is.release.used property to true if SNAPSHOT is NOT used,
to the project version otherwise -->
<id>build-helper-regex-is-snapshot-used</id>
<phase>validate</phase>
<goals>
<goal>regex-property</goal>
</goals>
<configuration>
<name>skip.when.is.release.used</name>
<value>${project.version}</value>
<regex>^((?!-SNAPSHOT).)*$</regex>
<replacement>true</replacement>
<failIfNoMatch>false</failIfNoMatch>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${plugin.deploy.version}</version>
<configuration>
<skip>${skip.when.is.release.used}</skip>
</configuration>
</plugin>
<!-- following plugins added just for test they were configured globally -->
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<defaults>
<name>tag</name>
</defaults>
<source>
def fileContents = new File("${project.basedir}/CHANGELOG.md").getText('UTF-8')
matcher = (fileContents =~ /(?s).\[v$project.version\].*?/)
if (!matcher.find()) {
throw new IllegalArgumentException("Tag [v$project.version] not found in ${project.basedir}/CHANGELOG.md")
}
assert matcher[0][1]: "Tag [v$project.version] not found in ${project.basedir}/CHANGELOG.md"
</source>
</configuration>
</execution>
</executions>
</plugin> </plugins>
</build>
</profile>
<profile>
<id>gcube-developer</id>
<activation>
<activeByDefault>false</activeByDefault>
<jdk>[1.8,9)</jdk>
<property>
<name>!Release</name>
</property>
</activation>
<properties>
<!-- This profile sets an additional parameter for javadoc generation to disables the doclint.