@Service public class JarPackaging extends AbstractPackagingProvider
PackagingProvider that creates a JAR file.| Modifier and Type | Field and Description |
|---|---|
static String |
NAME |
fileManager, LOGGER, pathResolver, ROO_PACKAGING_PROVIDER_PROPERTY| Constructor and Description |
|---|
JarPackaging()
Constructor invoked by the OSGi container
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
createPom(org.springframework.roo.model.JavaPackage topLevelPackage,
String nullableProjectName,
String javaVersion,
GAV parentPom,
String moduleName,
ProjectOperations projectOperations)
Creates the Maven POM using the subclass' POM template as follows:
sets the parent POM to the given parent (if any)
sets the groupId to the result of
AbstractPackagingProvider.getGroupId(org.springframework.roo.model.JavaPackage), omitting this
element if it's the same as the parent's groupId (as per Maven best
practice)
sets the artifactId to the result of AbstractPackagingProvider.getArtifactId(java.lang.String, java.lang.String, org.springframework.roo.model.JavaPackage)
sets the packaging to the result of #getName()
sets the project name to the result of AbstractPackagingProvider.getProjectName(java.lang.String, java.lang.String, org.springframework.roo.model.JavaPackage)
replaces all occurrences of AbstractPackagingProvider.JAVA_PRODUCT_VERSION_PLACEHOLDER with
the given Java version
This method makes as few assumptions about the POM template as possible,
to make life easier for anyone writing a PackagingProvider. |
Collection<Path> |
getPaths()
|
boolean |
isDefault()
Indicates whether this type of packaging should be used for new projects
and modules by default, i.e. when the user doesn't specify the packaging.
|
protected void |
setPackagingProviderId(Document pom)
Stores the ID of this
PackagingProvider as a POM property called
"roo.packaging.provider". |
activate, createArtifacts, createOtherArtifacts, getArtifactId, getFileManager, getFullyQualifiedModuleName, getGroupId, getId, getPathResolver, getProjectName, setGroupIdAndParentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateArtifacts, getIdpublic static final String NAME
protected String createPom(org.springframework.roo.model.JavaPackage topLevelPackage, String nullableProjectName, String javaVersion, GAV parentPom, String moduleName, ProjectOperations projectOperations)
AbstractPackagingProviderAbstractPackagingProvider.getGroupId(org.springframework.roo.model.JavaPackage), omitting this
element if it's the same as the parent's groupId (as per Maven best
practice)AbstractPackagingProvider.getArtifactId(java.lang.String, java.lang.String, org.springframework.roo.model.JavaPackage)#getName()AbstractPackagingProvider.getProjectName(java.lang.String, java.lang.String, org.springframework.roo.model.JavaPackage)AbstractPackagingProvider.JAVA_PRODUCT_VERSION_PLACEHOLDER with
the given Java versionPackagingProvider.createPom in class AbstractPackagingProvidertopLevelPackage - the new project or module's top-level Java package
(required)nullableProjectName - the project name provided by the user (can be blank)javaVersion - the Java version to substitute into the POM (required)parentPom - the Maven coordinates of the parent POM (can be
null)moduleName - the unqualified name of the Maven module to which the new
POM belongsprojectOperations - cannot be injected otherwise it's a circular
dependencypublic Collection<Path> getPaths()
PackagingProviderpublic boolean isDefault()
PackagingProvider
If the user defines their own PackagingProviders, they should
ensure that at most one of them returns true from this
method.
isDefault in interface PackagingProviderprotected final void setPackagingProviderId(Document pom)
AbstractPackagingProviderPackagingProvider as a POM property called
"roo.packaging.provider". Subclasses can override this
method, but be aware that Roo needs some way of working out from a given
pom.xml file which PackagingProvider should be used.setPackagingProviderId in class AbstractPackagingProviderpom - the DOM document for the POM being createdCopyright © 2009–2017 Pivotal Software, Inc.. All rights reserved.