亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? assemblemojo.java

?? portal越來越流行了
?? JAVA
字號:
/*
 * 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.
 */
package org.apache.pluto.maven;

import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.apache.pluto.util.UtilityException;
import org.apache.pluto.util.assemble.Assembler;
import org.apache.pluto.util.assemble.AssemblerConfig;
import org.apache.pluto.util.assemble.AssemblerFactory;

/**
 * The AssembleMojo is responsible for assembling a web application for deployment
 * into the Pluto portlet container.  Assembly, in this context, is the process of
 * updating a web application's WEB-INF/web.xml with Pluto specific parameters for 
 * deployment in Pluto.   
 * <p>
 * This Mojo is able to operate on individual descriptors by specifying 
 * <code>portletXml</code>, <code>webXml</code>, and <code>webXmlDestination</code>.
 * If your project uses standard Maven 2 directory layouts, the defaults will
 * provide proper values.
 * <p/>
 * Example Maven 2 <code>pom.xml</code> usage:
 * <pre>
 * &lt;project&gt;
 *   ...
 *   &lt;build&gt;
 *      &lt;plugins&gt;
 *          &lt;plugin&gt;
 *              &lt;groupId&gt;org.apache.pluto&lt;/groupId&gt;
 *              &lt;artifactId&gt;maven-pluto-plugin&lt;/artifactId&gt;
 *          &lt;/plugin&gt;
 *      &lt;/plugins&gt;
 *   &lt;/build&gt;
 *   ...
 * &lt;/project&gt;
 * </pre>
 * <p>
 * This Mojo can also operate on entire WAR or EAR archive files by specifying
 * a list of archive path names in <code>archives</code>.
 * <p/>
 * Example Maven 2 <code>pom.xml</code> usage:
 * <pre>
 * &lt;project&gt;
 *   ...
 *   &lt;build&gt;
 *      &lt;plugins&gt;
 *          &lt;plugin&gt;
 *              &lt;groupId&gt;org.apache.pluto&lt;/groupId&gt;
 *              &lt;artifactId&gt;maven-pluto-plugin&lt;/artifactId&gt;
 *              &lt;executions&gt;
 *                  &lt;execution&gt;
 *                      &lt;phase&gt;package&lt;/phase&gt;
 *                      &lt;goals&gt;
 *                          &lt;goal&gt;assemble&lt;/goal&gt;
 *                      &lt;/goals&gt;
 *                      &lt;configuration&gt;
 *                          &lt;assemblyOutputDirectory&gt;${project.build.directory}/assembled-wars&lt;/assemblyOutputDirectory&gt;
 *                          &lt;archives&gt;
 *                              &lt;assembleArchive&gt;
 *                                  ${project.build.directory}/wartoassemble.war
 *                              &lt;/assembleArchive&gt;
 *                              &lt;assembleArchive&gt;
 *                                  ${project.build.directory}/anotherwartoassemble.war
 *                              &lt;/assembleArchive&gt;
 *                          &lt;/archives&gt;
 *                      &lt;/configuration&gt;
 *                  &lt;/execution&gt;
 *              &lt;/executions&gt;
 *          &lt;/plugin&gt;
 *      &lt;/plugins&gt;
 *   &lt;/build&gt;
 *   ...
 * &lt;/project&gt;
 * </pre>
 * 
 * @since Jul 30, 2005
 * @see org.apache.pluto.util.assemble.Assembler 
 * 
 * @goal assemble
 * @description prepares a web application as a portlet application
 * @phase process-resources
 */
public class AssembleMojo extends AbstractPortletMojo {

	// Private Member Variables ------------------------------------------------

    /**
     * The portlet application descriptor (<code>WEB-INF/portlet.xml</code>).
     * @parameter expression="${basedir}/src/main/webapp/WEB-INF/portlet.xml"
     * @required
     */
    private File portletXml;

    /**
     * The original webapp descriptor (<code>WEB-INF/web.xml</code>).
     * @parameter expression="${basedir}/src/main/webapp/WEB-INF/web.xml"
     * @required
     */
    private File webXml;

    /**
     * The file to which the updated webapp descriptor is written.
     * @parameter expression="${project.build.directory}/pluto-resources/web.xml"
     */
    private File webXmlDestination;

    /**
     * The name of the dispatch servlet class to use
     * @parameter
     */
    private String dispatchServletClass;
    
    /**
     * A list of archive files to assemble.  Only EAR and WAR file
     * types are supported.  
     * <p/>
     * Each value in the list is the absolute pathname to the 
     * archive being assembled.
     * <p/>
     * This parameter is mutually exclusive with portletXml, webXml, 
     * and webXmlDestination parameters.  
     * 
     * @parameter alias="warFiles"
     */
    private List archives;

    /**
     * @deprecated see archives parameter
     * @parameter
     */
    private List warFiles;
    
    /**
     * Destination directory the assembled files are written out to.
     * @parameter alias="warFilesDestination" expression="${project.build.directory}/pluto-assembled-wars"
     */
    private File assemblyOutputDirectory;
    
    /**
     * Destination directory the assembled files are written out to.
     * @parameter
     * @deprecated see assemblyOutputDirectory parameter
     */
    private File warFilesDestination;

    // AbstractPlutoMojo Impl --------------------------------------------------

    protected void doExecute() throws MojoExecutionException {       
        
        // Log parameter values.
    	Log log = getLog();
        if (log.isInfoEnabled()) {
            if (archives == null || archives.isEmpty()) {
                log.info("Reading web.xml from :" + webXml.getAbsolutePath());
                log.info("Reading portlet.xml from: " + portletXml.getAbsolutePath());
                log.info("Writing web.xml to: " + webXmlDestination.getAbsolutePath());
            }               
        }
        
        try {
            // Assemble portlet app by updating web.xml.
            if (archives == null || archives.isEmpty()) {        
                AssemblerConfig config = createAssemblerConfig();
                Assembler assembler = AssemblerFactory.getFactory()
            		    .createAssembler(config);
                assembler.assemble(config);
            } else {
                for (Iterator i = archives.iterator(); i.hasNext();) {
                    File archive = new File(i.next().toString());
                    if (log.isInfoEnabled()) {
                        log.info("Assembling archive file " + archive.getAbsolutePath() + 
                                " to directory " + assemblyOutputDirectory.getAbsolutePath());
                    }                
                    AssemblerConfig config = createArchiveAssemblerConfig(archive, assemblyOutputDirectory);
                    Assembler assembler = AssemblerFactory.getFactory()
                        .createAssembler(config);
                    assembler.assemble(config);
                }
            }
        } catch (UtilityException e) {
            log.error("Assembly failed: " + e.getMessage(), e);
        }
    }

    protected void doValidate() throws MojoExecutionException {
        Log log = getLog();
        
        // Support for the old 'warFiles' mojo parameter.  Apparently
        // the alias for the 'archives' parameter doesn't work properly.
        if (! (warFiles == null || warFiles.isEmpty()) ) {
            log.warn( "'warFiles' parameter is deprecated.  Use 'archives' parameter instead." );
            if ( archives == null ) {
                archives = new ArrayList();
            }
            archives.addAll( warFiles );
        }
        
        // Warn if the old 'warFilesDestination' mojo parameter is used
        if ( warFilesDestination != null ) {
            log.warn( "'warFilesDestination' parameter is deprecated.  Use 'assemblyOutputDirectory' instead." );
            assemblyOutputDirectory = warFilesDestination;
        }
        
        // If a list of war files are supplied:
        //   1) webXml, portletXml, and webXmlDestination parameters are ignored
        //   2) verify the files in the List exist.
        //   3) verify the destination is a directory, or create it if it doesn't exist.
        
        // A list of files was supplied so we ignore other parameters. 
        if (archives != null && !archives.isEmpty()) {
            if (webXml != null) {
                log.debug("archives parameter and webXml parameter are mutually exclusive.  Ignoring webXml parameter.");
            }
            if (portletXml != null) {
                log.debug("archives parameter and portletXml parameter are mutually exclusive.  Ignoring portletXml parameter.");
            }
            if (webXmlDestination != null) {
                log.debug("archives parameter and webXmlDestination parameter are mutually exclusive.  Ignoring webXmlDestination parameter.");
            }
            
            // verify each file can be found
            for (Iterator i = archives.iterator(); i.hasNext();) {
                File f = new File(i.next().toString());
                if (!f.exists()) {
                    log.warn("File " + f.getAbsolutePath() + " does not exist.");
                    i.remove();
                    continue;
                }
                if (!f.canRead()) {
                    log.warn("File " + f.getAbsolutePath() + " exists but cannot be read.");
                    i.remove();
                    continue;
                }
            }
            
            // check to see if the warFiles list is now empty
            if (archives.isEmpty()) {
                throw new MojoExecutionException("No war files could be installed due errors.");
            }
             
            // check to see if the dest dir exists or create it.
            if (!assemblyOutputDirectory.exists()) {
                if (log.isDebugEnabled()) {
                    log.debug("Creating destination directory for assembled war files: " + assemblyOutputDirectory.getAbsolutePath());
                }
                try {                    
                    if(!assemblyOutputDirectory.mkdirs()) {
                        throw new MojoExecutionException("Unable to create destination directory for assembled war files: " + 
                                assemblyOutputDirectory.getAbsolutePath());
                    }                        
                } catch (SecurityException e) {
                    throw new MojoExecutionException("Unable to create destination directory for assembled war files: " + e.getMessage(), e);
                }
            } else {
                if (!assemblyOutputDirectory.isDirectory()) {
                    throw new MojoExecutionException("Specified destination for assembled war files " +
                            assemblyOutputDirectory.getAbsolutePath() + " is not a directory!");
                }
                if (!assemblyOutputDirectory.canRead()||!assemblyOutputDirectory.canWrite()) {
                    throw new MojoExecutionException("Unable to read or write to destination directory for assembed war files.  " +
                            "Check permissions on the directory " + assemblyOutputDirectory.getAbsolutePath());
                }
            }
            
        // A list of archive files was not provided, so use the other parameters instead.
            
        } else {            
            if (webXml == null || !webXml.exists()) {
                throw new MojoExecutionException("Web application descriptor must be a valid web.xml");
            }
            if (portletXml == null || !portletXml.exists()) {
                throw new MojoExecutionException("Portlet descriptor must be a valid portlet.xml");
            }
        }
    }

    // Private Methods ---------------------------------------------------------

    private AssemblerConfig createAssemblerConfig() {
        AssemblerConfig config = new AssemblerConfig();
        config.setPortletDescriptor(portletXml);
        config.setWebappDescriptor(webXml);
        config.setDestination(webXmlDestination);
        config.setDispatchServletClass(dispatchServletClass);
        return config;
    }
    
    private AssemblerConfig createArchiveAssemblerConfig(File archiveToAssemble, File destinationDirectory) {
        AssemblerConfig config = new AssemblerConfig();
        config.setDispatchServletClass(dispatchServletClass);
        config.setSource(archiveToAssemble);
        config.setDestination(destinationDirectory);
        return config;
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕在线免费不卡| 精品88久久久久88久久久| 亚洲激情欧美激情| 26uuu精品一区二区| 国产一区二区电影| 调教+趴+乳夹+国产+精品| 国产欧美1区2区3区| 国产三级精品视频| 久久久九九九九| 91精彩视频在线观看| 欧美艳星brazzers| 色综合久久中文字幕综合网| 色激情天天射综合网| 欧美丰满美乳xxx高潮www| 欧美一级国产精品| 成人国产精品免费观看视频| 不卡视频免费播放| 欧美日韩国产综合视频在线观看| 日韩视频免费观看高清完整版| 国产精品少妇自拍| 青青青伊人色综合久久| 成人午夜又粗又硬又大| 欧美一区二区福利视频| 欧美高清dvd| 国产人久久人人人人爽| 国产精品国产成人国产三级 | 亚洲另类在线一区| 精久久久久久久久久久| 91原创在线视频| 欧美一三区三区四区免费在线看| 国产欧美精品区一区二区三区| 亚洲成人自拍网| 粉嫩aⅴ一区二区三区四区| 欧美丝袜自拍制服另类| 欧美va亚洲va| 午夜视黄欧洲亚洲| 国产黑丝在线一区二区三区| 91精品国产aⅴ一区二区| 欧美日韩精品一区二区三区四区| 国产一区不卡视频| 成人av高清在线| 一区二区三区四区高清精品免费观看| 亚洲视频一二三区| 99视频在线精品| 国产欧美日韩不卡| 国产精品亚洲午夜一区二区三区| 欧美mv日韩mv亚洲| 国模一区二区三区白浆| 91精品免费观看| 午夜精品久久久久久久久久久| 粉嫩av一区二区三区在线播放| 欧美二区在线观看| 亚洲情趣在线观看| 91在线国产福利| 免费成人在线播放| 欧美片在线播放| 日本欧美一区二区在线观看| 日韩一区二区免费在线观看| 国产成人av一区二区三区在线观看| 国产精品久久久99| 在线观看av一区| 久久精品国产精品亚洲综合| 亚洲精品一区二区三区精华液| 蜜臂av日日欢夜夜爽一区| 日韩一区二区三区在线观看| 精品一区二区影视| 欧美激情一区二区三区在线| 色综合久久久久久久久久久| 日韩av高清在线观看| 久久婷婷色综合| 97精品电影院| 天天综合色天天综合| 国产日韩综合av| 欧美日韩国产一区| 蜜桃久久av一区| 2020国产精品| 在线亚洲免费视频| 日韩激情一区二区| 日韩精品一区二区三区中文精品| 不卡一区在线观看| 午夜国产精品一区| 国产精品私人自拍| 欧美一区二区三区视频| 99在线精品观看| 国产精品影视在线| 亚洲成国产人片在线观看| 国产精品免费视频网站| 日韩免费高清av| 色综合天天综合在线视频| 天天综合色天天| 91精彩视频在线观看| 波多野结衣在线aⅴ中文字幕不卡| 蜜桃视频第一区免费观看| 欧美区一区二区三区| 色偷偷久久一区二区三区| 国产mv日韩mv欧美| 国产乱码精品一区二区三区忘忧草 | 99久久婷婷国产综合精品| 欧美国产日韩亚洲一区| 精品久久久久久久一区二区蜜臀| 欧美三级中文字幕| 欧美美女bb生活片| 欧美视频中文字幕| 欧美调教femdomvk| 成人综合在线视频| 日韩理论电影院| 国产精品拍天天在线| 亚洲精品在线电影| 91精品国产综合久久久久久久| 欧洲中文字幕精品| 91麻豆精品国产91久久久| 精品成人在线观看| 国产精品亲子伦对白| 91精品国产手机| 日韩欧美久久一区| 中文字幕一区二区三区蜜月| 中文一区一区三区高中清不卡| 亚洲一区二区精品3399| 人人精品人人爱| 国产成人自拍网| 日本丰满少妇一区二区三区| 久久电影网站中文字幕| 91啦中文在线观看| 欧美精品一级二级| 国产精品视频在线看| 日本不卡一区二区三区| 9i看片成人免费高清| 日韩一区二区视频| 综合在线观看色| 日韩欧美国产午夜精品| 中文字幕一区二区三区色视频| 中文字幕日韩一区| 日本欧美一区二区在线观看| 丁香激情综合国产| 日韩欧美亚洲国产精品字幕久久久| 国产精品久久精品日日| 精品成人a区在线观看| 国产精品毛片a∨一区二区三区| 亚洲一区二区三区影院| 国产一区二区不卡在线| 欧美久久一区二区| 国产精品久久精品日日| 久久99精品久久久| 欧美日韩在线播放一区| 樱花影视一区二区| 亚洲视频在线观看一区| 成人三级伦理片| 久久九九久久九九| 韩国女主播成人在线| 久久久久久久综合色一本| 亚洲1区2区3区4区| 91麻豆免费看| 亚洲激情第一区| 欧美亚一区二区| 亚洲国产综合91精品麻豆| 欧美综合一区二区| 天天av天天翘天天综合网| 91麻豆精品国产91久久久久久久久 | 久久精品久久99精品久久| 欧美一区二区三区免费视频 | 日韩av在线播放中文字幕| 欧美一区二区三区啪啪| 国产一区二区免费看| 国产精品免费免费| 日韩成人午夜电影| 91麻豆精品国产自产在线观看一区| 六月婷婷色综合| 99久久久久免费精品国产| 亚洲色图欧美激情| 欧美日韩视频在线观看一区二区三区| 亚洲精品视频在线观看网站| 日本中文字幕不卡| 日韩精品最新网址| 狠狠色综合色综合网络| 国产欧美精品在线观看| av高清不卡在线| 亚洲一区二区三区四区的| 555www色欧美视频| 中文字幕 久热精品 视频在线| fc2成人免费人成在线观看播放| 一区二区三区精品在线| 欧美美女激情18p| 国产美女精品人人做人人爽| 亚洲图片你懂的| 欧美三级电影在线观看| 日韩电影免费在线| 国产精品午夜免费| 日韩电影在线看| 国产婷婷色一区二区三区四区| 日本道精品一区二区三区| 免费成人av资源网| 最新日韩av在线| 欧美xxxxx牲另类人与| 91免费国产在线| 国产一区二区三区在线观看免费 | 欧美日韩日日骚| 大陆成人av片| 国产成人免费视| 蜜桃视频第一区免费观看| 亚洲国产综合色|