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

martin_s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva-components.git

commit 8af179aa4461b7bf94a47a03f573b50b1252b447
Author: Martin Stockhammer <[email protected]>
AuthorDate: Wed Nov 27 22:42:43 2019 +0100

    Fixing javadoc content generation
---
 checkoutSite.sh |  8 +++++++
 deploySite.sh   |  6 +++++-
 pom.xml         | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 3 files changed, 78 insertions(+), 3 deletions(-)

diff --git a/checkoutSite.sh b/checkoutSite.sh
index 5e582bd..4df9d84 100755
--- a/checkoutSite.sh
+++ b/checkoutSite.sh
@@ -42,6 +42,7 @@ CLONE=1
 FORCE=1
 MODULE_DIR="${MY_PWD}"
 PATTERN=""
+BRANCH="master"
 while [ ! -z "$1" ]; do
   case "$1" in
     -f) 
@@ -67,6 +68,11 @@ while [ ! -z "$1" ]; do
       MODULE_DIR="$1"
       shift
       ;;
+    -b)
+      shift
+      BRANCH="$1"
+      shift
+      ;;
     *)
       GIT_REMOTE="$1"
       shift
@@ -119,6 +125,8 @@ fi
 
 cd "${SITE_DIR}" || { echo "Could not change to site dir ${SITE_DIR}"; exit 1; 
}
 
+git checkout "${BRANCH}"
+
 git config core.sparsecheckout true
 git config user.name "${GIT_USER}"
 git config user.email "${GIT_EMAIL}"
diff --git a/deploySite.sh b/deploySite.sh
index 776a5e2..147e396 100755
--- a/deploySite.sh
+++ b/deploySite.sh
@@ -29,6 +29,10 @@ THIS_DIR=$(readlink -f ${THIS_DIR})
 CONTENT_DIR=".site-content"
 BRANCH="asf-staging-3.0"
 
+if grep -q '<scmPublishBranch>' pom.xml; then
+  BRANCH=$(sed -n -e 's/.*<scmPublishBranch>\(.*\)<\/scmPublishBranch>.*/\1/p' 
pom.xml)
+fi
+
 SUB_DIR="components"
 
 if [ -d "${CONTENT_DIR}/.git" ]; then
@@ -49,7 +53,7 @@ echo "> If everything is fine enter yes. After that the 
publish process will be
 echo -n "Do you want to publish (yes/no)? "
 read ANSWER
 
-if [ "${ANSWER}" == "yes" -o "${ANSWER}" == "YES" ]; then
+if [ "${ANSWER}" == "yes" -o "${ANSWER}" == "YES" -o "${ANSWER}" == "y" -o 
"${ANSWER}" == "Y" ]; then
   echo "> Starting publish process"
   mvn scm-publish:publish-scm "$@"
 else
diff --git a/pom.xml b/pom.xml
index a39ca59..e23e7ea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,6 +59,8 @@
     <site.staging.base>${project.basedir}</site.staging.base>
 
     
<asciidoctor.maven.plugin.version>2.0.0-RC.1</asciidoctor.maven.plugin.version>
+
+    <scmPublishBranch>asf-staging</scmPublishBranch>
   </properties>
 
   <description>Parent Pom for various components used in Apache Archiva and 
Redback.</description>
@@ -299,6 +301,13 @@
             <linksource>true</linksource>
             <show>protected</show>
             <quiet>true</quiet>
+            <isOffline>false</isOffline>
+            
<excludePackageNames>org.apache.archiva.components.*.test</excludePackageNames>
+            <links>
+              <link>https://junit.org/junit5/docs/current/api</link>
+              <link>http://www.quartz-scheduler.org/api/2.3.0</link>
+              
<link>https://docs.spring.io/autorepo/docs/spring/${spring.version}.RELEASE/javadoc-api</link>
+            </links>
             <tags>
               <tag>
                 <name>todo</name>
@@ -356,7 +365,7 @@
           <skipDeletedFiles>true</skipDeletedFiles>
           <content>${project.build.directory}/staging</content>
           <tryUpdate>true</tryUpdate>
-          <scmBranch>asf-staging-3.0</scmBranch>
+          <scmBranch>${scmPublishBranch}</scmBranch>
           <!--
                     <ignorePathsToDelete>
                       <path>%regex[^(?!docs/).*$]</path>
@@ -440,8 +449,16 @@
           <linksource>true</linksource>
           <show>protected</show>
           <quiet>true</quiet>
+          <doctitle>Archiva Components API</doctitle>
+          <isOffline>false</isOffline>
+          
<excludePackageNames>org.apache.archiva.components.*.test</excludePackageNames>
+          <links>
+            <link>https://junit.org/junit5/docs/current/api</link>
+            <link>http://www.quartz-scheduler.org/api/2.3.0</link>
+            
<link>https://docs.spring.io/autorepo/docs/spring/${spring.version}.RELEASE/javadoc-api</link>
+          </links>
           <tags>
-            <tag>
+          <tag>
               <name>todo</name>
               <placement>a</placement>
               <head>To Do:</head>
@@ -489,6 +506,52 @@
         </plugins>
       </build>
     </profile>
+    <!--
+This runs a sparse git checkout for the web site content repository that 
contains only the doc directory.
+The profile is activated only, if the checkout directory does not exist.
+The executor runs a shell script.
+-->
+    <profile>
+      <id>site-checkout</id>
+      <activation>
+        <file>
+          <missing>${scmPubCheckoutDirectory}</missing>
+        </file>
+        <os>
+          <family>unix</family>
+        </os>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.6.0</version>
+            <inherited>false</inherited>
+            <executions>
+              <execution>
+                <id>prepare-checkout</id>
+                <phase>pre-site</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+                <configuration>
+                  <executable>checkoutSite.sh</executable>
+                  <workingDirectory>${project.basedir}</workingDirectory>
+                  <arguments>
+                    <argument>-d</argument>
+                    <argument>${scmPubCheckoutDirectory}</argument>
+                    <argument>-b</argument>
+                    <argument>${scmPublishBranch}</argument>
+                    <argument>${siteRepositoryUrl}</argument>
+                  </arguments>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 
 </project>

Reply via email to