Skip to content

Commit

Permalink
HOP-2274 Declare all plugins with annotations only (Jandex)
Browse files Browse the repository at this point in the history
- Add jandex-maven-plugin to build process
- JarFileCache use jandex library
- Remove plugin.xml files
- Remove plugin.xml codes
- Remove scannotation library
- FatJarBuilder build index annotation for already indexed jars
  • Loading branch information
nadment committed Dec 6, 2020
1 parent 55fcedd commit 3454acc
Show file tree
Hide file tree
Showing 145 changed files with 662 additions and 1,883 deletions.
25 changes: 10 additions & 15 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
<jsch.version>0.1.54</jsch.version>
<jzlib.version>1.0.7</jzlib.version>
<ognl.version>2.6.9</ognl.version>
<scannotation.version>1.0.2</scannotation.version>
<woodstox-core-asl.version>4.4.1</woodstox-core-asl.version>
<woodstox-core-asl.version>4.4.1</woodstox-core-asl.version>
<httpclient.version>4.5.3</httpclient.version>
<httpccore.version>4.4.6</httpccore.version>
<xmlunit.version>1.5</xmlunit.version>
<javassist.version>3.20.0-GA</javassist.version>
<json-simple.version>1.1.1</json-simple.version>
<gson.version>2.8.5</gson.version>
<jackson.version>2.10.2</jackson.version>
<jandex.version>2.2.2.Final</jandex.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -364,6 +364,11 @@
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<version>${jandex.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
Expand Down Expand Up @@ -408,18 +413,7 @@
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.scannotation</groupId>
<artifactId>scannotation</artifactId>
<version>${scannotation.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
Expand Down Expand Up @@ -540,7 +534,8 @@
</configuration>
</execution>
</executions>
</plugin>
</plugin>
</plugins>
</build>

</project>
105 changes: 0 additions & 105 deletions core/src/main/java/org/apache/hop/core/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -643,41 +643,16 @@ public static final boolean isUsingSimpleStackTraces() {
*/
public static final String VERSION_COMMENT_EDIT_VERSION = "Modification by user";

/**
* The XML file that contains the list of native Hop transforms
*/
public static final String XML_FILE_HOP_TRANSFORMS = "hop-transforms.xml";

/**
* The name of the environment variable that will contain the alternative location of the hop-transforms.xml file
*/
public static final String HOP_CORE_TRANSFORMS_FILE = "HOP_CORE_TRANSFORMS_FILE";

/**
* The XML file that contains the list of native partition plugins
*/
public static final String XML_FILE_HOP_PARTITION_PLUGINS = "hop-partition-plugins.xml";

/**
* The name of the environment variable that will contain the alternative location of the hop-workflow-actions.xml file
*/
public static final String HOP_CORE_WORKFLOW_ACTIONS_FILE = "HOP_CORE_WORKFLOW_ACTIONS_FILE";

/**
* The XML file that contains the list of native Hop Carte Servlets
*/
public static final String XML_FILE_HOP_SERVLETS = "hop-servlets.xml";

/**
* The XML file that contains the list of native Hop value metadata plugins
*/
public static final String XML_FILE_HOP_VALUEMETA_PLUGINS = "hop-valuemeta-plugins.xml";

/**
* The XML file that contains the list of native Hop two-way password encoder plugins
*/
public static final String XML_FILE_HOP_PASSWORD_ENCODER_PLUGINS = "hop-password-encoder-plugins.xml";

/**
* The name of the environment variable that will contain the alternative location of the hop-valuemeta-plugins.xml
* file
Expand All @@ -700,11 +675,6 @@ public static final boolean isUsingSimpleStackTraces() {
*/
public static final String HOP_TWO_WAY_PASSWORD_ENCODER_SEED = "HOP_TWO_WAY_PASSWORD_ENCODER_SEED";

/**
* The XML file that contains the list of native Hop logging plugins
*/
public static final String XML_FILE_HOP_LOGGING_PLUGINS = "hop-logging-plugins.xml";

/**
* The name of the environment variable that will contain the alternative location of the hop-logging-plugins.xml
* file
Expand Down Expand Up @@ -748,81 +718,6 @@ public static final boolean isUsingSimpleStackTraces() {
*/
public static final String HOP_DISABLE_CONSOLE_LOGGING = "HOP_DISABLE_CONSOLE_LOGGING";

/**
* The XML file that contains the list of native Hop actions
*/
public static final String XML_FILE_HOP_WORKFLOW_ACTIONS = "hop-workflow-actions.xml";

/**
* The XML file that contains the list of native Hop database types (MySQL, Oracle, etc)
*/
public static final String XML_FILE_HOP_DATABASE_TYPES = "hop-database-types.xml";

/**
* The XML file that contains the list of native Hop database types (MySQL, Oracle, etc)
*/
public static final String XML_FILE_HOP_SEARCH_ANALYSER_PLUGINS = "hop-search-analyser-plugins.xml";

/**
* The XML file that contains the list of native Hop database types (MySQL, Oracle, etc)
*/
public static final String XML_FILE_HOP_VFS_PLUGINS = "hop-vfs-plugins.xml";

/**
* The XML file that contains the list of native Hop metadata plugins (DatabaseMeta, HopServer, ...)
*/
public static final String XML_FILE_HOP_METADATA_PLUGINS = "hop-metadata-plugins.xml";

/**
* The XML file that contains the list of native config plugins
*/
public static final String XML_FILE_HOP_CONFIG_PLUGINS = "hop-config-plugins.xml";

/**
* The XML file that contains the list of native Hop database types (MySQL, Oracle, etc)
*/
public static final String XML_FILE_HOP_GUI_PLUGINS = "hop-gui-plugins.xml";

/**
* The XML file that contains the list of native Hop database types (MySQL, Oracle, etc)
*/
public static final String XML_FILE_HOP_PERSPECTIVE_PLUGINS = "hop-perspective-plugins.xml";

/**
* The XML file that contains the list of native Hop database types (MySQL, Oracle, etc)
*/
public static final String XML_FILE_HOP_FILE_TYPES = "hop-file-types.xml";

/**
* The XML file that contains the list of native Hop compression providers (None, ZIP, GZip, etc.)
*/
public static final String XML_FILE_HOP_COMPRESSION_PROVIDERS = "hop-compression-providers.xml";

/**
* The XML file that contains the list of native Hop compression providers (None, ZIP, GZip, etc.)
*/
public static final String XML_FILE_HOP_AUTHENTICATION_PROVIDERS = "hop-authentication-providers.xml";

/**
* The XML file that contains the list of native extension points (None by default, this is mostly for OEM purposes)
*/
public static final String XML_FILE_HOP_EXTENSION_POINTS = "hop-extension-points.xml";

/**
* The XML file that contains the list of lifecycle listeners
*/
public static final String XML_FILE_HOP_LIFECYCLE_LISTENERS = "hop-lifecycle-listeners.xml";

/**
* The XML file that contains the list of native pipeline engines
*/
public static final String XML_FILE_HOP_PIPELINE_ENGINES = "hop-pipeline-engines.xml";

/**
* The XML file that contains the list of native workflow engines
*/
public static final String XML_FILE_HOP_WORKFLOW_ENGINES = "hop-workflow-engines.xml";

/**
* the value the Pan JVM should return on exit.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

package org.apache.hop.core.config.plugin;

import org.apache.hop.core.Const;
import org.apache.hop.core.exception.HopPluginException;
import org.apache.hop.core.plugins.BasePluginType;
import org.apache.hop.core.plugins.IPluginType;
import org.apache.hop.core.plugins.PluginAnnotationType;
Expand Down Expand Up @@ -53,30 +51,6 @@ public static ConfigPluginType getInstance() {
return pluginType;
}

protected void registerPluginJars() throws HopPluginException {
super.registerPluginJars();
}

@Override
protected String getXmlPluginFile() {
return Const.XML_FILE_HOP_CONFIG_PLUGINS;
}

@Override
protected String getMainTag() {
return "config-plugins";
}

@Override
protected String getSubTag() {
return "config-plugin";
}

@Override
protected String getPath() {
return "./";
}

public String[] getNaturalCategoriesOrder() {
return new String[ 0 ];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import org.apache.commons.lang.StringUtils;
import org.apache.hop.core.Const;
import org.apache.hop.core.exception.HopPluginException;
import org.apache.hop.core.plugins.BasePluginType;
import org.apache.hop.core.plugins.IPluginType;

Expand Down Expand Up @@ -56,32 +55,6 @@ public static DatabasePluginType getInstance() {
return pluginType;
}



protected void registerPluginJars() throws HopPluginException {
super.registerPluginJars();
}

@Override
public String getXmlPluginFile() {
return Const.XML_FILE_HOP_DATABASE_TYPES;
}

@Override
public String getMainTag() {
return "database-types";
}

@Override
public String getSubTag() {
return "database-type";
}

@Override
protected String getPath() {
return "./";
}

public String[] getNaturalCategoriesOrder() {
return new String[ 0 ];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.hop.core.Const;
import org.apache.hop.core.exception.HopValueException;
import org.apache.hop.core.gui.plugin.GuiElementType;
import org.apache.hop.core.gui.plugin.GuiPlugin;
import org.apache.hop.core.gui.plugin.GuiWidgetElement;
import org.apache.hop.core.row.IValueMeta;

Expand All @@ -37,7 +38,11 @@
* @author Matt
* @since 11-mrt-2005
*/

@DatabaseMetaPlugin(
type = "GENERIC",
typeDescription = "Generic database"
)
@GuiPlugin(description="Generic database GUI Plugin")
public class GenericDatabaseMeta extends BaseDatabaseMeta implements IDatabase {
public static final String ATRRIBUTE_CUSTOM_DRIVER_CLASS = "CUSTOM_DRIVER_CLASS";
public static final String DATABASE_DIALECT_ID = "DATABASE_DIALECT_ID";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.hop.core.exception.HopDatabaseException;
import org.apache.hop.core.row.IValueMeta;

@DatabaseMetaPlugin(type = "NONE", typeDescription = "No connection type")
public class NoneDatabaseMeta extends BaseDatabaseMeta implements IDatabase {
@Override public String getFieldDefinition( IValueMeta v, String tk, String pk, boolean useAutoInc, boolean addFieldname, boolean addCr ) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
* @author Matt
* @since 17-12-2003
*/
@TwoWayPasswordEncoderPlugin(
id = "Hop",
name = "Hop Password Encoder",
description = "Hop Password Encoder"
)
public class HopTwoWayPasswordEncoder implements ITwoWayPasswordEncoder {
private static final HopTwoWayPasswordEncoder instance = new HopTwoWayPasswordEncoder();
private static final int RADIX = 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

package org.apache.hop.core.encryption;

import org.apache.hop.core.Const;
import org.apache.hop.core.plugins.BasePluginType;
import org.apache.hop.core.plugins.IPluginType;
import org.apache.hop.core.plugins.PluginAnnotationType;
Expand Down Expand Up @@ -54,24 +53,6 @@ public static TwoWayPasswordEncoderPluginType getInstance() {
return twoWayPasswordEncoderPluginType;
}

@Override
protected String getXmlPluginFile() {
return Const.XML_FILE_HOP_PASSWORD_ENCODER_PLUGINS;
}

@Override
protected String getAlternativePluginFile() {
return Const.HOP_PASSWORD_ENCODER_PLUGINS_FILE;
}

@Override public String getMainTag() {
return "password-encoder-plugins";
}

@Override public String getSubTag() {
return "password-encoder-plugin";
}

@Override
protected boolean isReturn() {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

package org.apache.hop.core.extension;

import org.apache.hop.core.Const;
import org.apache.hop.core.plugins.BasePluginType;
import org.apache.hop.core.plugins.IPluginType;
import org.apache.hop.core.plugins.PluginAnnotationType;
Expand Down Expand Up @@ -52,24 +51,6 @@ public static ExtensionPointPluginType getInstance() {
return pluginType;
}

@Override
protected String getXmlPluginFile() {
return Const.XML_FILE_HOP_EXTENSION_POINTS;
}

@Override public String getMainTag() {
return "extension-points";
}

@Override public String getSubTag() {
return "extension-point";
}

@Override
protected String getPath() {
return "./";
}

public String[] getNaturalCategoriesOrder() {
return new String[ 0 ];
}
Expand Down
Loading

0 comments on commit 3454acc

Please sign in to comment.