Re: Launcher script issues in 3.5.0.

2017-02-22 Thread Christian Schulte
Am 02/23/17 um 04:21 schrieb Igor Fedorenko:
> On all platforms .mvn/ search is expected to start with directory
> specified by -f parameter and keep doing "cd .." until it files .mvn/
> subdirectory or hits the filesystem root.

What if I put a .mvn directory at the file system root? Will that become
the default for everything when there is no other .mvn found before?

> The idea is to use .mvn/ subdirectory as a marker of multimodule project
> basedir. The build can be started from any submodule, but multimodule
> project basedir will be always the same.

That's how I understood it as well. If it does not stop anywhere but the
drive root, this will lead to invalid project base directories as soon
as someone adds a .mvn directory somewhere inappropriate. I am not using
that feature myself, so just wanted to be sure. The patch does not
change the logic in any way. Just makes it work for directory names like
"Spaces & Special Char". I'll merge it, if no one objects.

Regards,
-- 
Christian


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: Launcher script issues in 3.5.0.

2017-02-22 Thread Igor Fedorenko
On all platforms .mvn/ search is expected to start with directory
specified by -f parameter and keep doing "cd .." until it files .mvn/
subdirectory or hits the filesystem root.

The idea is to use .mvn/ subdirectory as a marker of multimodule project
basedir. The build can be started from any submodule, but multimodule
project basedir will be always the same.

-- 
Regards,
Igor

On Wed, Feb 22, 2017, at 09:19 PM, Christian Schulte wrote:
> Both issues seem to be related to MNG-5889. MNG-5889 branch created. If
> no one objects, I'll merge it to master when the build job completed
> successfully on Jenkins. Otherwise consider the MNG-5889 branch yours.
> Note: I just noticed that the Windows launcher does not stop searching
> for the .mvn directory at the directory given by the -f option. Search
> does not stop until the drive root has been reached (like C:). I am not
> sure this is intended.
> 
> Regards,
> -- 
> Christian
> 
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
> 

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: Launcher script issues in 3.5.0.

2017-02-22 Thread Christian Schulte
Both issues seem to be related to MNG-5889. MNG-5889 branch created. If
no one objects, I'll merge it to master when the build job completed
successfully on Jenkins. Otherwise consider the MNG-5889 branch yours.
Note: I just noticed that the Windows launcher does not stop searching
for the .mvn directory at the directory given by the -f option. Search
does not stop until the drive root has been reached (like C:). I am not
sure this is intended.

Regards,
-- 
Christian


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: Launcher script issues in 3.5.0.

2017-02-22 Thread Christian Schulte
Please see the attachment. Can someone please review this and apply the
patches. Both launchers - Windows and Unix - should support directory
names like "Spaces & Special Char" with this patch applied. I do not
know what JIRA issue corresponds to these changes.

Regards,
-- 
Christian

diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 95a407d..cfb39b0 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -141,9 +141,9 @@ find_file_argument_basedir() {
   found_file_switch=0
   for arg in "$@"; do
 if [ ${found_file_switch} -eq 1 ]; then
-  if [ -f ${arg} ]; then
-basedir=$(dirname $(readlink -f "${arg}"))
-if [ ! -d ${basedir} ]; then
+  if [ -f "${arg}" ]; then
+basedir=$(dirname "$(readlink -f "${arg}")")
+if [ ! -d "${basedir}" ]; then
   echo "Directory ${basedir} extracted from the -f/--file command-line argument ${arg} does not exist" >&2
   exit 1
 fi
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index e527188..c86662b 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -120,7 +120,7 @@ if not exist "%FILE_ARG%" (
   echo POM file %FILE_ARG% specified the -f/--file command-line argument does not exist >&2
   goto error
 )
-call :get_directory_from_file %FILE_ARG%
+call :get_directory_from_file "%FILE_ARG%"
 if not exist "%POM_DIR%" (
   echo Directory %POM_DIR% extracted from the -f/--file command-line argument %FILE_ARG% does not exist >&2
   goto error


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Re: Launcher script issues in 3.5.0.

2017-02-22 Thread Christian Schulte
See the attached patch. This should make the Unix launcher support
directory names like "Spaces & Special Char". At least here:

SH_VERSION='@(#)PD KSH v5.2.14 99/07/13.2'

Can someone review and apply this patch please. Thanks.

Regards,
-- 
Christian

diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 95a407d..cfb39b0 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -141,9 +141,9 @@ find_file_argument_basedir() {
   found_file_switch=0
   for arg in "$@"; do
 if [ ${found_file_switch} -eq 1 ]; then
-  if [ -f ${arg} ]; then
-basedir=$(dirname $(readlink -f "${arg}"))
-if [ ! -d ${basedir} ]; then
+  if [ -f "${arg}" ]; then
+basedir=$(dirname "$(readlink -f "${arg}")")
+if [ ! -d "${basedir}" ]; then
   echo "Directory ${basedir} extracted from the -f/--file command-line argument ${arg} does not exist" >&2
   exit 1
 fi


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Launcher script issues in 3.5.0.

2017-02-22 Thread Christian Schulte
Hi,

our launchers (both Unix and Windows) still seem to be broken for
directory names like "Spaces & Special Char".

pwd
/home/schulte
$ mvn -version
Apache Maven 3.5.0-SNAPSHOT (e6217a455547e5b3bcac310be18daf2a333cd5d1;
2017-02-21T01:24:24+01:00)
Maven home: /home/schulte/Applications/apache-maven-3.5.0-SNAPSHOT
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /usr/local/jdk-1.7.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "openbsd", version: "6.0", arch: "amd64", family: "unix"

$ env LANG=C mvn -f "/tmp/Spaces\ \&\ Special\
Char/maven-invoker-plugin/pom.xml" clean

/home/schulte/Applications/apache-maven-3.5.0-SNAPSHOT/bin/mvn[171]: [:
\&\: unexpected operator/operand
POM file /tmp/Spaces\ \&\ Special\ Char/maven-invoker-plugin/pom.xml
specified with the -f/--file command line argument does not exist
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM /tmp/Spaces\ \&\ Special\
Char/maven-invoker-plugin/pom.xml: /tmp/Spaces\ \&\ Special\
Char/maven-invoker-plugin/pom.xml (No such file or directory) @


$ env LANG=C mvn -f /tmp/Spaces\ \&\ Special\
Char/maven-invoker-plugin/pom.xml clean

/home/schulte/Applications/apache-maven-3.5.0-SNAPSHOT/bin/mvn[171]: [:
&: unexpected operator/operand
POM file /tmp/Spaces & Special Char/maven-invoker-plugin/pom.xml
specified with the -f/--file command line argument does not exist
[INFO] Scanning for projects...
[INFO]
[INFO]

[INFO] Building Apache Maven Invoker Plugin 3.0.0-SNAPSHOT
[INFO]

[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @
maven-invoker-plugin ---

Something similar is happening on Windows. On Unix, the mvn launcher
fails as soon as it is used in a directory like "Spaces & Special Char".
On Windows this works. So on Windows only the -f option is affected. Can
someone take a look, please?

Just checkout some project into a directory with a name like "Spaces &
Special Char" and try to execute Maven from inside that directory and
from outside that directory using the -f option pointing to the pom
inside that directory. It won't work on Unix and Windows. I somehow lost
track on all those launcher related issues for 3.5.0 but this should
work with 3.5.0.

Regards,
-- 
Christian

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org