本文整理汇总了Java中org.apache.maven.archiver.MavenArchiveConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java MavenArchiveConfiguration类的具体用法?Java MavenArchiveConfiguration怎么用?Java MavenArchiveConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MavenArchiveConfiguration类属于org.apache.maven.archiver包,在下文中一共展示了MavenArchiveConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseManifestConfiguration
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private static ManifestConfiguration parseManifestConfiguration(BeanConfigurator beanConfigurator,
MavenProject project) throws MojoExecutionException {
MavenArchiveConfiguration archiveConfiguration = new MavenArchiveConfiguration();
BeanConfigurationRequest beanConfiguration = new DefaultBeanConfigurationRequest()
.setBean(archiveConfiguration)
.setConfiguration(project.getModel(), "org.apache.maven.plugins", "maven-jar-plugin", "default-jar");
beanConfiguration.setConfiguration(beanConfiguration.getConfiguration(), "archive");
try {
beanConfigurator.configureBean(beanConfiguration);
} catch (BeanConfigurationException e) {
throw new MojoExecutionException("Error parsing archive configuration", e);
}
return archiveConfiguration.getManifest();
}
示例2: execute
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
@Override
public void execute() throws MojoExecutionException {
switch(type) {
case runnable:
if (mainClass == null) {
throw new MojoExecutionException( "runnable archive need mainClass configured" );
}
MavenArchiveConfiguration archive = getArchive();
archive.getManifest().setMainClass(mainClass);
ArtifactHelper helper = new ArtifactHelper(unzip, system,
localRepository, getProject().getRemoteArtifactRepositories());
File output = new File( getProject().getBuild().getOutputDirectory());
helper.unzip(output, "org.jruby", "jruby-complete", jrubyVersion);
helper.unzip(output, "org.jruby.mains", "jruby-mains", jrubyMainsVersion);
case archive:
break;
default:
throw new MojoExecutionException("can not pack archive " + type + " with jruby-jar-plugin");
}
super.execute();
}
示例3: addMultiReleaseManifestEntry
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void addMultiReleaseManifestEntry() throws MojoExecutionException {
try {
Field archive = AbstractJarMojo.class.getDeclaredField("archive");
archive.setAccessible(true);
MavenArchiveConfiguration config = (MavenArchiveConfiguration) archive.get(this);
config.addManifestEntry("Multi-Release", "true");
} catch (NoSuchFieldException | IllegalAccessException e) {
throw new MojoExecutionException("Could not modify the archive configuration.", e);
}
}
示例4: ArchiveTask
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
public ArchiveTask(
MavenArchiveConfiguration archiveConfig ,JarArchiver lexArchiver
,String classifier
,String id, String version, String name,String description
,List<String> categories, Boolean trial
,String luceeCoreVersion, String luceeLoaderVersion ,Boolean startBundles
,List<? extends Config> cacheHandlers ,List<? extends Config> ormEngines
,List<? extends Config> monitors ,List<? extends Config> searchEngines
,List<? extends Config> resourceProviders ,List<? extends Config> amfs
,List<? extends Config> jdbcDrivers ,List<? extends Config> mappings
,List<? extends Config> eventGateways
) {
this.archiveConfig = archiveConfig;
this.lexArchiver = lexArchiver;
this.classifier = classifier;
this.id = id;
this.version = version;
this.name = name;
this.description = description;
this.categories = categories;
this.trial = trial;
this.luceeCoreVersion = luceeCoreVersion;
this.luceeLoaderVersion = luceeLoaderVersion;
this.startBundles = startBundles;
this.cacheHandlers = cacheHandlers;
this.ormEngines = ormEngines;
this.monitors = monitors;
this.searchEngines = searchEngines;
this.resourceProviders = resourceProviders;
this.amfs = amfs;
this.jdbcDrivers = jdbcDrivers;
this.mappings = mappings;
this.eventGateways = eventGateways;
}
示例5: getArchive
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private MavenArchiveConfiguration getArchive() throws MojoExecutionException {
try {
Field archiveField = getClass().getSuperclass().getSuperclass().getDeclaredField("archive");
archiveField.setAccessible(true);
return (MavenArchiveConfiguration) archiveField.get(this);
} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
throw new MojoExecutionException("can not use reflection", e);
}
}
示例6: packageCompiledSources
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void packageCompiledSources() throws DependencyResolutionRequiredException, IOException, ManifestException {
MavenArchiver archiver = new MavenArchiver();
archiver.setArchiver(sourcesArchiver);
Path pluginJarFile = getDataOutputDirectory().resolve(PluginUtils.PLUGIN_IMPLEMENTATION_FILE);
getLog().debug(String.format("Packing plugin sources to %s", pluginJarFile.toString()));
archiver.setOutputFile(pluginJarFile.toFile());
sourcesArchiver.addDirectory(compiledSourcesDir);
archiver.createArchive(session, project, new MavenArchiveConfiguration());
}
示例7: packagePlugin
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void packagePlugin() throws DependencyResolutionRequiredException, IOException, ManifestException {
MavenArchiver archiver = new MavenArchiver();
archiver.setArchiver(pluginArchiver);
Path pluginFile = getPluginFile();
getLog().info(String.format("Creating plugin file: %s", pluginFile));
archiver.setOutputFile(pluginFile.toFile());
pluginArchiver.addDirectory(dataOutputDirectory);
pluginArchiver.addConfiguredManifest(getPluginManifest());
archiver.createArchive(session, project, new MavenArchiveConfiguration());
}
示例8: execute
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
// Check the target file
File modelDir = new File( this.project.getBuild().getOutputDirectory());
if( ! modelDir.exists())
throw new MojoExecutionException( "The model could not be found. " + modelDir );
File targetDir = new File( this.project.getBuild().getDirectory());
String archiveName = this.project.getBuild().getFinalName() + ".zip";
File archiveFile = new File( targetDir, archiveName );
// Configure the archive creation
MavenArchiver archiver = new MavenArchiver();
archiver.setArchiver( this.jarArchiver );
archiver.setOutputFile( archiveFile );
// Add the application directories
try {
archiver.getArchiver().addDirectory( modelDir );
MavenArchiveConfiguration conf = new MavenArchiveConfiguration();
conf.setCompress( true );
archiver.createArchive( this.session, this.project, conf );
this.project.getArtifact().setFile( archiveFile );
} catch( Exception e ) {
throw new MojoExecutionException( "Exception while packaging.", e );
}
}
示例9: JubeArchiveConfigurationSource
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
public JubeArchiveConfigurationSource(MavenProject project, MavenSession mavenSession, MavenArchiveConfiguration archiveConfiguration,
MavenFileFilter mavenFilter, String[] descriptors, String[] descriptorRefs) {
this.project = project;
this.mavenSession = mavenSession;
this.archiveConfiguration = archiveConfiguration;
this.mavenFilter = mavenFilter;
this.descriptors = descriptors;
this.descriptorRefs = descriptorRefs;
}
示例10: createHeaderArchive
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void createHeaderArchive ( final CompileCommand compileCommand, final List<HeaderFilesDirective> finalHeaderFilesDirectives, final List<String> classifiers ) throws MojoExecutionException
{
try
{
MavenArchiver mavenArchiver = new MavenArchiver();
mavenArchiver.setArchiver( jarArchiver );
final File jarFile = File.createTempFile( "tmp", ".har", buildDirectory );
mavenArchiver.setOutputFile( jarFile );
for ( HeaderFilesDirective headerFilesDirective : finalHeaderFilesDirectives )
{
mavenArchiver.getArchiver().addDirectory( new File( headerFilesDirective.getDirectory() ), headerFilesDirective.getIncludes(), headerFilesDirective.getExcludes() );
}
final MavenArchiveConfiguration mavenArchiveConfiguration = new MavenArchiveConfiguration();
mavenArchiveConfiguration.setAddMavenDescriptor( false );
mavenArchiver.createArchive( project, mavenArchiveConfiguration );
for ( String classifier : classifiers )
{
getLog().debug( "Attaching 'har' classifier=" + classifier + " file=" + jarFile );
projectHelper.attachArtifact( project, Const.ArtifactType.NATIVE_HEADER_ARCHIVE, classifier, jarFile );
}
}
catch ( Exception e )
{
throw new MojoExecutionException( e.getMessage() );
}
}
示例11: perform
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
@Override
public void perform(final DARMojoContext context) throws IOException {
final Log log = context.getLog();
final MavenArchiveConfiguration archiveConfiguration =
context.getArchiveConfiguration();
archiveConfiguration.getManifestEntries().put(
"Diffusion-Version",
context.getMinimumDiffusionVersion());
log.debug("Manifest entries: " +
archiveConfiguration.getManifestEntries());
}
示例12: getArchive
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public MavenArchiveConfiguration getArchive()
{
return archive;
}
示例13: addStringEntry
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void addStringEntry(MavenArchiveConfiguration archiveConfig, String key, String value) {
if (value != null && !archiveConfig.getManifestEntries().containsKey(key)) {
archiveConfig.addManifestEntry(key, '"' + value + '"');
}
}
示例14: addBooleanEntry
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void addBooleanEntry(MavenArchiveConfiguration archiveConfig, String key, Boolean value) {
if (value != null && !archiveConfig.getManifestEntries().containsKey(key)) {
archiveConfig.addManifestEntry(key, String.valueOf(value));
}
}
示例15: addConfigListEntry
import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void addConfigListEntry(MavenArchiveConfiguration archiveConfig, String key, List<? extends Config> configs) {
if (configs.size() > 0 && !archiveConfig.getManifestEntries().containsKey(key)) {
archiveConfig.addManifestEntry(key, '"'+toJsonArray(configs)+'"');
}
}