You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2021/10/17 16:58:58 UTC

[maven] branch MNG-7129 updated: add missing license

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MNG-7129
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/MNG-7129 by this push:
     new 0c56674  add missing license
0c56674 is described below

commit 0c566740b5341c74830e612b1425ea7d81249825
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sun Oct 17 18:58:55 2021 +0200

    add missing license
---
 maven-core/pom.xml                                 |  1 -
 .../org/apache/maven/project/MavenProject.java     | 27 ++++------------------
 .../src/main/resources/cache-config-instance.xml   | 20 ++++++++++++++++
 maven-core/src/main/resources/cache-config.xsd     | 20 ++++++++++++++++
 .../src/main/resources/cache-domain-instance.xml   | 20 ++++++++++++++++
 maven-core/src/main/resources/cache-domain.xsd     | 20 ++++++++++++++++
 6 files changed, 85 insertions(+), 23 deletions(-)

diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 822287a..9dd0250 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -192,7 +192,6 @@ under the License.
               <exclude>plugin-manager.txt</exclude>
               <exclude>project-builder.txt</exclude>
               <exclude>src/site/resources/design/**</exclude>
-              <exclude>src/main/resources/cache-*</exclude>
             </excludes>
           </configuration>
         </plugin>
diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
index 0ecd943..67e88db 100644
--- a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
+++ b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
@@ -1157,14 +1157,9 @@ public class MavenProject
     @Override
     public String toString()
     {
-        StringBuilder sb = new StringBuilder( 128 );
-        sb.append( "MavenProject: " );
-        sb.append( getGroupId() );
-        sb.append( ':' );
-        sb.append( getArtifactId() );
-        sb.append( ':' );
-        sb.append( getVersion() );
-        sb.append( " @ " );
+        StringBuilder sb =
+            new StringBuilder( 128 ).append( "MavenProject: " ).append( getGroupId() ).append( ':' )
+                .append( getArtifactId() ).append( ':' ).append( getVersion() ).append( " @ " );
 
         try
         {
@@ -1581,12 +1576,9 @@ public class MavenProject
         if ( path != null )
         {
             path = path.trim();
-            if ( path.length() != 0 )
+            if ( ( path.length() != 0 ) && !getScriptSourceRoots().contains( path ) )
             {
-                if ( !getScriptSourceRoots().contains( path ) )
-                {
-                    getScriptSourceRoots().add( path );
-                }
+                getScriptSourceRoots().add( path );
             }
         }
     }
@@ -1637,14 +1629,12 @@ public class MavenProject
                      || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
             {
                 Dependency dependency = new Dependency();
-
                 dependency.setArtifactId( a.getArtifactId() );
                 dependency.setGroupId( a.getGroupId() );
                 dependency.setVersion( a.getVersion() );
                 dependency.setScope( a.getScope() );
                 dependency.setType( a.getType() );
                 dependency.setClassifier( a.getClassifier() );
-
                 list.add( dependency );
             }
         }
@@ -1682,14 +1672,12 @@ public class MavenProject
         for ( Artifact a : getArtifacts() )
         {
             Dependency dependency = new Dependency();
-
             dependency.setArtifactId( a.getArtifactId() );
             dependency.setGroupId( a.getGroupId() );
             dependency.setVersion( a.getVersion() );
             dependency.setScope( a.getScope() );
             dependency.setType( a.getType() );
             dependency.setClassifier( a.getClassifier() );
-
             list.add( dependency );
         }
         return Collections.unmodifiableList( list );
@@ -1713,14 +1701,12 @@ public class MavenProject
             if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
             {
                 Dependency dependency = new Dependency();
-
                 dependency.setArtifactId( a.getArtifactId() );
                 dependency.setGroupId( a.getGroupId() );
                 dependency.setVersion( a.getVersion() );
                 dependency.setScope( a.getScope() );
                 dependency.setType( a.getType() );
                 dependency.setClassifier( a.getClassifier() );
-
                 list.add( dependency );
             }
         }
@@ -1802,21 +1788,18 @@ public class MavenProject
         }
 
         List<Dependency> list = new ArrayList<>( artifacts.size() );
-
         for ( Artifact a : getArtifacts() )
         {
             // TODO let the scope handler deal with this
             if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
             {
                 Dependency dependency = new Dependency();
-
                 dependency.setArtifactId( a.getArtifactId() );
                 dependency.setGroupId( a.getGroupId() );
                 dependency.setVersion( a.getVersion() );
                 dependency.setScope( a.getScope() );
                 dependency.setType( a.getType() );
                 dependency.setClassifier( a.getClassifier() );
-
                 list.add( dependency );
             }
         }
diff --git a/maven-core/src/main/resources/cache-config-instance.xml b/maven-core/src/main/resources/cache-config-instance.xml
index 79f7422..6855592 100644
--- a/maven-core/src/main/resources/cache-config-instance.xml
+++ b/maven-core/src/main/resources/cache-config-instance.xml
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+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.
+-->
+
 <cache xmlns="org:apache:maven:cache:config:v1"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="org:apache:maven:cache:config:v1 cache-config.xsd">
diff --git a/maven-core/src/main/resources/cache-config.xsd b/maven-core/src/main/resources/cache-config.xsd
index 1f5eb4e..69437d9 100644
--- a/maven-core/src/main/resources/cache-config.xsd
+++ b/maven-core/src/main/resources/cache-config.xsd
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+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.
+-->
+
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:c="org:apache:maven:cache:config:v1"
            xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
diff --git a/maven-core/src/main/resources/cache-domain-instance.xml b/maven-core/src/main/resources/cache-domain-instance.xml
index 1c859de..101a011 100644
--- a/maven-core/src/main/resources/cache-domain-instance.xml
+++ b/maven-core/src/main/resources/cache-domain-instance.xml
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+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.
+-->
+
 <build xmlns="org:apache:maven:cache:domain"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="org:apache:maven:cache:domain cache-domain.xsd">
diff --git a/maven-core/src/main/resources/cache-domain.xsd b/maven-core/src/main/resources/cache-domain.xsd
index 48446ca..c233ed4 100644
--- a/maven-core/src/main/resources/cache-domain.xsd
+++ b/maven-core/src/main/resources/cache-domain.xsd
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+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.
+-->
+
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:d="org:apache:maven:cache:domain"
            elementFormDefault="qualified"