Giter Site home page Giter Site logo

garysweaver / unplutofy Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 116 KB

Unplutofy provides a command-line tool, Ant task, Maven 2 plugin, and a Java API to remove the changes that Apache Pluto makes to a portlet war file during pluto-fication.

License: Other

Shell 0.82% Java 99.18%

unplutofy's Introduction

Unplutofy

Given a war file, unplutofy:

  1. Removes all "servlet" elements that contain either "portlet-class" or a "param-name" element with value "portlet-name".
  2. Removes all "servlet-mapping" elements that contain either "PlutoInvoker" or a "servlet-name" element with value of the "portlet-name" element as defined in portlet.xml.
  3. Removes all "taglib" elements that contain "/portlet.tld".
  4. Removes all portlet*.tld files from the war.

Features

Support for calling service from Ant, Maven, command-line, or via API.

Prerequisites for Build

Install Maven 2.

Install Git.

Clone the Project's Git Repository

Change directory to your favorite directory and clone the repo:

git clone http://github.com/garysweaver/unplutofy.git

Build

Run the build:

mvn clean install

Environment Variables for Command-line Usage

Set the UNPLUTOFY_HOME environment variable to the base directory of the project. For example, for OS X with bash, you might add the following to your .bash_profile and restart Terminal.app:

export UNPLUTOFY_HOME=~/unplutofy

Test by doing the following in the project directory:

cd bin
unplutofy

Command-line Usage

Back up the war file before attempting to use this. For example:

cp (input_war) (input_war.bak)

Usage:

unplutofy (input_war) (output_war)

Maven 2 Plugin Usage

Add as a build plugin to your pom.xml:

        <plugin>
            <groupId>unplutofy</groupId>
            <artifactId>unplutofy</artifactId>
            <version>1.0-SNAPSHOT</version>
            <executions>
                <execution>
                    <id>unplutofy a war</id>
                    <phase>compile</phase>
                    <goals>
                        <goal>unplutofy</goal>
                    </goals>
                    <configuration>
                        <inputFile>some/path/to/input.war</inputFile>
                        <outputFile>some/path/to/output.war</outputFile>
                    </configuration>
                </execution>
            </executions> 
        </plugin>

When it asks you to install it, install the jar using the command it provides using the jar under the target directory (assuming you built it), then build again.

(Maven mojo has not been tested at time of writing.)

Ant Task Usage

Copy target/unplutofy(version).jar to Ant's lib dir somewhere so Ant can get to it. Then add this to your build.xml:

<typedef name="unplutofy" classname="unplutofy.ant.task.UnplutofyTask"
         classpath="classes" loaderref="classes"/>

<target name="unplutofy-war">
    <unplutofy inputFile="some/path/to/input.war" outputFile="some/path/to/output.war"/>
</target>

(Ant task has not been tested at time of writing.)

Troubleshooting

If you get:

Exception in thread "main" java.lang.NoClassDefFoundError: unplutofy/commandline/UnplutofyCommand
Caused by: java.lang.ClassNotFoundException: unplutofy.commandline.UnplutofyCommand

It is because you didn't build it yet or it can't find the jar because of the name or you aren't in the bin directory. See build instructions above.

Warning

Read the code and understand what it does before executing it. Use these tools at your own risk.

License

Copyright (c) 2010 Gary S. Weaver, released under the MIT license.

unplutofy's People

Contributors

garysweaver avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.