How to display buildnumber in spring-based web application

后端 未结 3 2100
长情又很酷
长情又很酷 2021-02-14 10:16

I need to display build number in my index.jsp page





Title (build: B         
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-5408099190056760"
     data-ad-slot="7305827575"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>        </div>
      </div>
      
      <div class="fly-panel detail-box" id="flyReply">
        <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
          <legend>3条回答</legend>        </fieldset>

        <ul class="jieda" id="jieda">
                    <li data-id="111" class="jieda-daan">
            <a name="item-1111111111"></a>
            <div class="detail-about detail-about-reply">
                         <a class="fly-avatar" href="">
                <img src="https://www.e-learn.cn/qa/data/avatar/000/00/01/small_000000120.jpg" alt=" 刺人心 ">
              </a>
              <div class="fly-detail-user">
                <a href="" class="fly-link">
                  <cite> 刺人心</cite>
                                             
                </a>
                
                <span>(楼主)</span>
            
              </div>              <div class="detail-hits">
                <span>2021-02-14 10:58</span>
              </div>

            </div>
            <div class="detail-body jieda-body photos">
              <p>          
<p>Here's how I've done it, using maven + jstl and leaving out Spring as it just makes it more complicated.</p>

<p>build.jsp</p>

<pre><code><%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<jsp:useBean id="dateValue" class="java.util.Date" />
<jsp:setProperty name="dateValue" property="time" value="${timestamp}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Build info


Build time:
Build number: ${buildNumber}
Branch: ${scmBranch}

Maven pom



  org.codehaus.mojo
  buildnumber-maven-plugin
  1.1
  
    
      validate
      
        create
      
      
        {0,date,yyDHHmm}
        
          timestamp
        
      
    
  
  
    {0,date,yyDHHmm}
    
      timestamp
    
  



    org.apache.maven.plugins
    maven-war-plugin
    
        
            
                src/main/webapp/
                
                    build.jsp
                
                true
                .
            
        
    

More details about the usage of buildnumber-maven-plugin can be found on the usage page.

提交回复
热议问题