[
https://issues.apache.org/jira/browse/MNG-7820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17763656#comment-17763656
]
ASF GitHub Bot commented on MNG-7820:
-------------------------------------
elharo commented on code in PR #1208:
URL: https://github.com/apache/maven/pull/1208#discussion_r1321373092
##########
maven-core/src/main/java/org/apache/maven/utils/dag/Dag.java:
##########
@@ -0,0 +1,255 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils.dag;
+
+/*
+ * Copyright The Codehaus Foundation.
Review Comment:
ditto. Possibly start here:
https://incubator.apache.org/ip-clearance/ip-clearance-template.html
##########
maven-core/src/main/java/org/apache/maven/utils/dag/CycleDetector.java:
##########
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils.dag;
+
+/*
+ * Copyright The Codehaus Foundation.
Review Comment:
as above
##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Locale;
+import java.util.stream.Stream;
+
+/**
+ * OS support
+ */
+public class Os {
+
+ /**
+ * The OS Name.
+ */
+ public static final String OS_NAME =
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OA architecture.
+ */
+ public static final String OS_ARCH =
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OS version.
+ */
+ public static final String OS_VERSION =
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * OS Family
+ */
+ public static final String OS_FAMILY;
+
+ public static final boolean IS_WINDOWS;
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WINDOWS = "windows";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WIN9X = "win9x";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_NT = "winnt";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_OS2 = "os/2";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_NETWARE = "netware";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_DOS = "dos";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_MAC = "mac";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_TANDEM = "tandem";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_UNIX = "unix";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_OPENVMS = "openvms";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_ZOS = "z/os";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_OS400 = "os/400";
+
+ /**
+ * OpenJDK is reported to call MacOS X "Darwin"
+ *
+ * @see <a
href="https://issues.apache.org/bugzilla/show_bug.cgi?id=44889">bugzilla
issue</a>
+ * @see <a
href="https://issues.apache.org/jira/browse/HADOOP-3318">HADOOP-3318</a>
+ */
+ private static final String DARWIN = "darwin";
+
+ /**
+ * The path separator.
+ */
+ private static final String PATH_SEP =
System.getProperty("path.separator");
+
+ static {
+ OS_FAMILY = getOsFamily();
+ IS_WINDOWS = isWindowsFamily();
+ }
+
+ private Os() {}
+
+ /**
+ * Determines if the OS on which Maven is executing matches the
+ * given OS family.
+ *
+ * @param family the family to check for
+ * @return true if the OS matches
+ *
+ */
+ public static boolean isFamily(String family) {
Review Comment:
I don't think this needs to be public, though perhaps I missed something.
It's definitely the wonkiest part of this code, so if we can make it private we
absolutely should.
##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Locale;
+import java.util.stream.Stream;
+
+/**
+ * OS support
+ */
+public class Os {
+
+ /**
+ * The OS Name.
+ */
+ public static final String OS_NAME =
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OA architecture.
+ */
+ public static final String OS_ARCH =
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OS version.
+ */
+ public static final String OS_VERSION =
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * OS Family
+ */
+ public static final String OS_FAMILY;
+
+ public static final boolean IS_WINDOWS;
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WINDOWS = "windows";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WIN9X = "win9x";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_NT = "winnt";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_OS2 = "os/2";
Review Comment:
remove or make private
##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Locale;
+import java.util.stream.Stream;
+
+/**
+ * OS support
+ */
+public class Os {
+
+ /**
+ * The OS Name.
+ */
+ public static final String OS_NAME =
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OA architecture.
+ */
+ public static final String OS_ARCH =
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OS version.
+ */
+ public static final String OS_VERSION =
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * OS Family
+ */
+ public static final String OS_FAMILY;
+
+ public static final boolean IS_WINDOWS;
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WINDOWS = "windows";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WIN9X = "win9x";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_NT = "winnt";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_OS2 = "os/2";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_NETWARE = "netware";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_DOS = "dos";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_MAC = "mac";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_TANDEM = "tandem";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_UNIX = "unix";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_OPENVMS = "openvms";
Review Comment:
not sure about these,but probably remove or make private
##########
maven-core/src/main/java/org/apache/maven/utils/dag/CycleDetectedException.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils.dag;
+
+/*
+ * Copyright The Codehaus Foundation.
Review Comment:
Might need an Apache lawyer here, but I suspect this isn't OK.
Also I really, really think this PR should be split up so easy parts like
removing StringUtils don't have to wait on complex issues like the status of
Codehaus copyright notices.
##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Locale;
+import java.util.stream.Stream;
+
+/**
+ * OS support
+ */
+public class Os {
+
+ /**
+ * The OS Name.
+ */
+ public static final String OS_NAME =
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OA architecture.
+ */
+ public static final String OS_ARCH =
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OS version.
+ */
+ public static final String OS_VERSION =
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * OS Family
+ */
+ public static final String OS_FAMILY;
+
+ public static final boolean IS_WINDOWS;
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WINDOWS = "windows";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WIN9X = "win9x";
Review Comment:
remove or make private
##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Locale;
+import java.util.stream.Stream;
+
+/**
+ * OS support
+ */
+public class Os {
+
+ /**
+ * The OS Name.
+ */
+ public static final String OS_NAME =
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OA architecture.
+ */
+ public static final String OS_ARCH =
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OS version.
+ */
+ public static final String OS_VERSION =
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * OS Family
+ */
+ public static final String OS_FAMILY;
+
+ public static final boolean IS_WINDOWS;
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WINDOWS = "windows";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WIN9X = "win9x";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_NT = "winnt";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_OS2 = "os/2";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_NETWARE = "netware";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_DOS = "dos";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_MAC = "mac";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_TANDEM = "tandem";
Review Comment:
remove or make private
##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Locale;
+import java.util.stream.Stream;
+
+/**
+ * OS support
+ */
+public class Os {
+
+ /**
+ * The OS Name.
+ */
+ public static final String OS_NAME =
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OA architecture.
+ */
+ public static final String OS_ARCH =
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * The OS version.
+ */
+ public static final String OS_VERSION =
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+ /**
+ * OS Family
+ */
+ public static final String OS_FAMILY;
+
+ public static final boolean IS_WINDOWS;
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WINDOWS = "windows";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_WIN9X = "win9x";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_NT = "winnt";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_OS2 = "os/2";
+
+ /**
+ * OS family that can be tested for. {@value}
+ */
+ public static final String FAMILY_NETWARE = "netware";
Review Comment:
surely we can get rid of Netware in 2023 and probably some of the others too.
> Remove dependency on plexus-utils
> ---------------------------------
>
> Key: MNG-7820
> URL: https://issues.apache.org/jira/browse/MNG-7820
> Project: Maven
> Issue Type: Task
> Reporter: Guillaume Nodet
> Priority: Major
> Fix For: 4.0.0-alpha-8
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)