You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@apache.org> on 2019/01/02 09:41:00 UTC
[jira] [Comment Edited] (SCM-777) Maven plugin's scm:validate
ignores scmCheckWorkingDirectoryUrl configuration in favor of system
property
[ https://issues.apache.org/jira/browse/SCM-777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16731877#comment-16731877 ]
Michael Osipov edited comment on SCM-777 at 1/2/19 9:40 AM:
------------------------------------------------------------
Yes, I know...
here's a minimal test case:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.group</groupId>
<artifactId>my-artifact</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<scm>
<connection>scm:svn:https://svn-path</connection>
<developerConnection>scm:svn:https://svn-path</developerConnection>
<url>https://svn-path</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<version>1.11.1</version>
<executions>
<execution>
<id>check scm</id>
<phase>validate</phase>
<goals>
<goal>validate</goal>
</goals>
<configuration>
<!-- This actually doesn't work -->
<scmCheckWorkingDirectoryUrl>true</scmCheckWorkingDirectoryUrl>
<systemProperties>
<!-- temporary hack until bug has been resolved -->
<scmCheckWorkingDirectoryUrl>true</scmCheckWorkingDirectoryUrl>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{code}
Running _mvn validate_ on this pom (on an incorrect svn path) will show an error as expected, but if you remove the _systemProperties_ configuration it dosn't work anymore.
And by the way. Happy new Year! :)
was (Author: schaller):
Yes, I know...
here's a minimal test case:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.group</groupId>
<artifactId>my-artifact</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<scm>
<connection>scm:svn:https://svn-path</connection>
<developerConnection>scm:svn:https://svn-path</developerConnection>
<url>https://svn-path</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<version>1.11.1</version>
<executions>
<execution>
<id>check scm</id>
<phase>validate</phase>
<goals>
<goal>validate</goal>
</goals>
<configuration>
<!-- This actually doesn't work -->
<scmCheckWorkingDirectoryUrl>true</scmCheckWorkingDirectoryUrl>
<systemProperties>
<!-- temporary hack until bug has been resolved -->
<scmCheckWorkingDirectoryUrl>true</scmCheckWorkingDirectoryUrl>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{code}
Running _mvn validate_ on this pom (on an incorrect svn path) will show an error as expected, but if you remove the _systemPropertyies_ configuration it dosn't work anymore.
And by the way. Happy new Year! :)
> Maven plugin's scm:validate ignores scmCheckWorkingDirectoryUrl configuration in favor of system property
> ---------------------------------------------------------------------------------------------------------
>
> Key: SCM-777
> URL: https://issues.apache.org/jira/browse/SCM-777
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-plugin
> Affects Versions: 1.9.1
> Environment: Java 7 x64 on Windows 7
> Reporter: Mark Herman
> Priority: Major
>
> org.apache.maven.scm.manager.AbstractScmManager.checkWorkingDirectoryUrl() uses... {code} Boolean.getBoolean( CHECK_WORKING_DIRECTORY_URL ) {code} ...in order to check if it should check the repository on scm:validate. This will only react to the system property, and not to the maven configuration.
> *Result:* no maven config will enable the check working directory option, only passing it in as a jvm argument.
> *Expected:* this should work:
> {code}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-scm-plugin</artifactId>
> <configuration>
> <scmCheckWorkingDirectoryUrl>true</scmCheckWorkingDirectoryUrl> <!-- this configuration is ignored, don't know why -->
> </configuration>
> <executions>
> <execution>
> <phase>validate</phase>
> <configuration>
> <scmCheckWorkingDirectoryUrl>true</scmCheckWorkingDirectoryUrl> <!-- neither does this -->
> </configuration>
> <goals>
> <goal>validate</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> {code}
> *Workaround:* Use <systemProperty> section. Tried <systemPropertyVariables> and for some reason that didn't appear to work.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)