initialize legal.source.folder property by plugin (#4358)

Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
diff --git a/pom.xml b/pom.xml
index 871a403..a35e5cc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 
-    Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
+    Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
 
     This program and the accompanying materials are made available under the
     terms of the Eclipse Public License v. 2.0, which is available at
@@ -794,6 +794,23 @@
         </pluginManagement>
         <plugins>
             <plugin>
+                <groupId>org.commonjava.maven.plugins</groupId>
+                <artifactId>directory-maven-plugin</artifactId>
+                <version>0.3.1</version>
+                <executions>
+                    <execution>
+                        <id>directories</id>
+                        <goals>
+                            <goal>execution-root</goal>
+                        </goals>
+                        <phase>initialize</phase>
+                        <configuration>
+                            <property>legal.source.folder</property>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.glassfish.jersey.tools.plugins</groupId>
                 <artifactId>jersey-doc-modulelist-maven-plugin</artifactId>
                 <inherited>false</inherited>
@@ -2036,7 +2053,6 @@
         </findbugs.glassfish.logging.validLoggerPrefixes>
         <java.version>1.8</java.version>
         <jersey.repackaged.prefix>jersey.repackaged</jersey.repackaged.prefix>
-        <legal.source.folder>${maven.multiModuleProjectDirectory}</legal.source.folder>
         <netbeans.hint.license>gf-cddl-gpl</netbeans.hint.license>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>