AMBARI-19219 - Add a Maven Target for ambari-server Which Updates the 
Configuration Markdown (jonathanhurley)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/44e60728
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/44e60728
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/44e60728

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 44e60728fe74ce80026eb96a220172f4488d203a
Parents: ab4b864
Author: Jonathan Hurley <[email protected]>
Authored: Thu Dec 15 15:56:55 2016 -0500
Committer: Jonathan Hurley <[email protected]>
Committed: Fri Dec 16 14:20:31 2016 -0500

----------------------------------------------------------------------
 ambari-server/pom.xml                           | 21 +++++++
 .../server/configuration/Configuration.java     | 16 ++++-
 .../server/configuration/index_template.md      | 63 --------------------
 .../server/configuration/index_template.md      | 63 ++++++++++++++++++++
 4 files changed, 97 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/44e60728/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index c2ecfe2..071d065 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -704,6 +704,27 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.2.1</version>
+        <executions>
+          <execution>
+            <id>configuration-markdown</id>
+            <phase>site</phase>
+            <goals>
+              <goal>java</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          
<mainClass>org.apache.ambari.server.configuration.Configuration</mainClass>
+          <arguments>
+            <argument>-output</argument>
+            
<argument>${basedir}/../ambari-server/docs/configuration/index.md</argument>
+          </arguments>
+        </configuration>
+      </plugin>
     </plugins>
     <resources>
       <resource>

http://git-wip-us.apache.org/repos/asf/ambari/blob/44e60728/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 22d8168..03af391 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -110,8 +110,17 @@ import com.google.inject.Singleton;
  * href=https://en.wikipedia.org/wiki/Markdown>Markdown</a> of all of the
  * properties, along with their default values and descriptions. This should be
  * done for every release so that the documentation of the configuration
- * properties can be kept current. The {@code index_template.md} file is used 
to generate
- * the markdown.
+ * properties can be kept current. The {@code index_template.md} file is used 
to
+ * generate the markdown.
+ * <p/>
+ * The markdown can also be generated by running the {@code site} phase in 
maven
+ * or by running the {@code exec:java} goal directly:
+ *
+ * <pre>
+ * mvn site
+ * mvn exec:java
+ * mvn exec:java@configuration-markdown (on maven 3.3.1 and later)
+ * </pre>
  */
 @Singleton
 public class Configuration {
@@ -5494,7 +5503,8 @@ public class Configuration {
 
       File file = new File(outputFile);
       FileUtils.writeStringToFile(file, markdown);
-      System.out.print("Successfully created " + outputFile);
+      System.out.println("Successfully created " + outputFile);
+      LOG.info("Successfully created {}", outputFile);
     } finally {
       IOUtils.closeQuietly(inputStream);
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/44e60728/ambari-server/src/main/java/org/apache/ambari/server/configuration/index_template.md
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/index_template.md
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/index_template.md
deleted file mode 100644
index 5c52013..0000000
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/index_template.md
+++ /dev/null
@@ -1,63 +0,0 @@
-<!---
-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.
--->
-
-Ambari Server Configuration
----
-- [Introduction](#introduction)
-- [Configuration Properties](#configuration-properties)
-- [Baseline Values](#baseline-values)
-- [Database And Persistence](#db-persistence)
-
-<a name="introduction"></a>
-## Introduction
-Ambari Server is configured using a flat text properties file. The file is 
read once when starting Ambari. Any changes made to the properties file are 
only reflected after restarting Ambari. 
-
-```
-/etc/ambari-server/conf/ambari.properties
-```
-
-<a name="configuration-properties"></a>
-## Configuration Properties
-The following are the properties which can be used to configure Ambari. 
-
-$configuration-properties
-
-<a name="baseline-values"></a>
-## Baseline Values
-As the size of a cluster grows, some of the default property values may no 
longer be sufficient. The below tables offer recommendations on the values of 
some configuration properties based on the size and usage of the cluster.
-
-$baseline-values
-
-<a name="db-persistence"></a>
-## Database And Persistence
-In addition to the static database connection properties, it's possible to 
supply custom properties for both EclipseLink and the database driver through 
`ambari.properties`. 
-
-### Database Driver
-Using the `server.jdbc.properties.` prefix, it's possible to supply specific 
properties to the database driver being used by Ambari. These properties do not 
affect JPA or any of the persistence-unit operations. They are solely to govern 
the behavior of the database driver. 
-
-```
-server.jdbc.properties.lockTimeout=15000
-server.jdbc.properties.loginTimeout=15000
-```
-
-### Persistence Unit
-EclipseLink properties can also be configured using a prefix of 
`server.persistence.properties.`. The EclipseLink properties should be defined 
in their entirety with the prefix prepended in front of them.
-
-```
-server.persistence.properties.eclipselink.jdbc.batch-writing.size=25
-server.persistence.properties.eclipselink.profiler=QueryMonitor
-```
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/44e60728/ambari-server/src/main/resources/org/apache/ambari/server/configuration/index_template.md
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/org/apache/ambari/server/configuration/index_template.md
 
b/ambari-server/src/main/resources/org/apache/ambari/server/configuration/index_template.md
new file mode 100644
index 0000000..5c52013
--- /dev/null
+++ 
b/ambari-server/src/main/resources/org/apache/ambari/server/configuration/index_template.md
@@ -0,0 +1,63 @@
+<!---
+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.
+-->
+
+Ambari Server Configuration
+---
+- [Introduction](#introduction)
+- [Configuration Properties](#configuration-properties)
+- [Baseline Values](#baseline-values)
+- [Database And Persistence](#db-persistence)
+
+<a name="introduction"></a>
+## Introduction
+Ambari Server is configured using a flat text properties file. The file is 
read once when starting Ambari. Any changes made to the properties file are 
only reflected after restarting Ambari. 
+
+```
+/etc/ambari-server/conf/ambari.properties
+```
+
+<a name="configuration-properties"></a>
+## Configuration Properties
+The following are the properties which can be used to configure Ambari. 
+
+$configuration-properties
+
+<a name="baseline-values"></a>
+## Baseline Values
+As the size of a cluster grows, some of the default property values may no 
longer be sufficient. The below tables offer recommendations on the values of 
some configuration properties based on the size and usage of the cluster.
+
+$baseline-values
+
+<a name="db-persistence"></a>
+## Database And Persistence
+In addition to the static database connection properties, it's possible to 
supply custom properties for both EclipseLink and the database driver through 
`ambari.properties`. 
+
+### Database Driver
+Using the `server.jdbc.properties.` prefix, it's possible to supply specific 
properties to the database driver being used by Ambari. These properties do not 
affect JPA or any of the persistence-unit operations. They are solely to govern 
the behavior of the database driver. 
+
+```
+server.jdbc.properties.lockTimeout=15000
+server.jdbc.properties.loginTimeout=15000
+```
+
+### Persistence Unit
+EclipseLink properties can also be configured using a prefix of 
`server.persistence.properties.`. The EclipseLink properties should be defined 
in their entirety with the prefix prepended in front of them.
+
+```
+server.persistence.properties.eclipselink.jdbc.batch-writing.size=25
+server.persistence.properties.eclipselink.profiler=QueryMonitor
+```
\ No newline at end of file

Reply via email to