public final class BaseKBean extends KBean implements JkBuildable.Supplier
Modifier and Type | Class and Description |
---|---|
static class |
BaseKBean.BaseScaffoldOptions |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CREATE_JAR_ACTION |
JkGitVersioning |
gitVersioning |
JkProjectPackaging.JarType |
jarType |
java.lang.String |
jvmOptions |
JkConsumers<JkManifest> |
manifestCustomizers |
java.lang.String |
moduleId |
JkRunnables |
packActions
Actions to execute when
pack() is invoked. |
java.lang.String |
programArgs |
Constructor and Description |
---|
BaseKBean() |
Modifier and Type | Method and Description |
---|---|
JkBuildable |
asBuildable() |
BaseKBean |
buildJar()
Builds a JAR file using the provided jarMaker
|
void |
createJavadocJar(java.nio.file.Path target)
Creates a Javadoc Jar file at the specified target path.
|
void |
createMainJar(java.nio.file.Path target)
Creates a main JAR file at the specified target path.
|
void |
createSourceJar(java.nio.file.Path target)
Creates a source JAR file at the specified target path.
|
void |
depTree() |
JkPathTree |
getAppClasses()
Returns a
JkPathTree representing the class files and sub-folders contained in the "bin" directory. |
java.util.List<java.nio.file.Path> |
getAppClasspath()
Returns the application classpath.
|
java.util.List<java.nio.file.Path> |
getAppLibs()
Returns a List of Path objects representing the libraries used by the application.
|
JkPathTree |
getAppSources()
Returns a JkPathTree representing the application sources.
|
JkBaseScaffold |
getBaseScaffold()
Returns the JkBaseScaffold object associated with this BaseKBean.
|
java.nio.file.Path |
getJarPath()
Returns the path to the JAR file created by
buildJar() method. |
java.lang.String |
getJarPathBaseName()
Returns the base name of the JAR file path created by the
buildJar() method. |
java.lang.String |
getMainClass()
Returns the actual main class to be used for launching the application or executable JAR.
|
JkManifest |
getManifest()
Returns the
JkManifest for the application. |
JkModuleId |
getModuleId()
Returns the module ID for this object.
|
JkVersion |
getVersion()
Returns the version of the application/library.
|
void |
info() |
protected void |
init()
This method is called by JeKa engine, right after public fields from command-line or properties have been injected.
|
void |
pack() |
JkJavaProcess |
prepareRunJar()
Prepares a {@link JkJavaProcess ready to run.
|
void |
runJar() |
void |
runMain() |
void |
scaffold() |
BaseKBean |
setJarMaker(java.util.function.Consumer<java.nio.file.Path> jarMaker)
Sets the jarMaker for creating a runnable fat jar.
|
BaseKBean |
setMainArtifactJarType(JkProjectPackaging.JarType jarType) |
BaseKBean |
setMainClassFinder(java.util.function.Supplier<java.lang.String> mainClassFinder)
Sets the main class finder for this project.
|
BaseKBean |
setModuleId(java.lang.String moduleId)
Sets the module ID for this object.
|
BaseKBean |
setVersion(java.lang.String version)
Sets the version for this BaseKBean.
|
BaseKBean |
setVersionSupplier(java.util.function.Supplier<JkVersion> versionSupplier)
Sets the version supplier for this BaseKBean.
|
void |
test() |
cleanOutput, find, getBaseDir, getBaseDirName, getBasePath, getImportedKBeans, getOutputDir, getRunbase, load, toString
public static final java.lang.String CREATE_JAR_ACTION
public java.lang.String jvmOptions
public java.lang.String programArgs
public java.lang.String moduleId
public JkProjectPackaging.JarType jarType
public JkGitVersioning gitVersioning
public final JkRunnables packActions
pack()
is invoked.By default, the build action creates a fat jar. It can be replaced by an action creating other jars/artifacts or doing special action as publishing a Docker image, for example.
public final JkConsumers<JkManifest> manifestCustomizers
protected void init()
KBean
Put your initialization/configuration code here.
public void runMain()
public void test()
public void pack()
public void runJar()
public void info()
public void depTree()
public void scaffold()
public BaseKBean buildJar()
public java.nio.file.Path getJarPath()
buildJar()
method.public java.lang.String getJarPathBaseName()
buildJar()
method.public BaseKBean setJarMaker(java.util.function.Consumer<java.nio.file.Path> jarMaker)
public BaseKBean setVersionSupplier(java.util.function.Supplier<JkVersion> versionSupplier)
public BaseKBean setVersion(java.lang.String version)
public JkVersion getVersion()
public JkModuleId getModuleId()
public BaseKBean setModuleId(java.lang.String moduleId)
moduleId
- The module ID formatted as group:name.public java.lang.String getMainClass()
null
if no main class has been detected.public JkBaseScaffold getBaseScaffold()
public BaseKBean setMainClassFinder(java.util.function.Supplier<java.lang.String> mainClassFinder)
public java.util.List<java.nio.file.Path> getAppClasspath()
public java.util.List<java.nio.file.Path> getAppLibs()
public JkPathTree getAppClasses()
JkPathTree
representing the class files and sub-folders contained in the "bin" directory.
The tree includes all files in the root directory and its subdirectories,
except for files matching the specified patterns.public JkManifest getManifest()
JkManifest
for the application.
The manifest includes the created by attribute,
the main class attribute, and the build JDK attribute.public void createMainJar(java.nio.file.Path target)
public void createJavadocJar(java.nio.file.Path target)
public void createSourceJar(java.nio.file.Path target)
public JkPathTree getAppSources()
public JkJavaProcess prepareRunJar()
public BaseKBean setMainArtifactJarType(JkProjectPackaging.JarType jarType)
public JkBuildable asBuildable()
asBuildable
in interface JkBuildable.Supplier