Skip to content
Commits on Source (6)
......@@ -8,3 +8,4 @@
webgen/out
webgen/webgen.cache
target
dependency-reduced-pom.xml
hawtjni (1.16-1) unstable; urgency=medium
* New upstream release
- Removed the patch
- Renamed maven-hawtjni-plugin to hawtjni-maven-plugin
* Standards-Version updated to 4.3.0
-- Emmanuel Bourg <ebourg@apache.org> Sat, 16 Feb 2019 00:30:51 +0100
hawtjni (1.15-3) unstable; urgency=medium
* Build depend on libplexus-component-metadata-java
......
......@@ -11,7 +11,7 @@ Build-Depends:
libplexus-component-metadata-java,
libxbean-java,
maven-debian-helper (>= 2.2)
Standards-Version: 4.2.1
Standards-Version: 4.3.0
Vcs-Git: https://salsa.debian.org/java-team/hawtjni.git
Vcs-Browser: https://salsa.debian.org/java-team/hawtjni
Homepage: http://fusesource.com/forge/sites/hawtjni/
......
......@@ -9,9 +9,9 @@ License: Eclipse-Public-License-v1.0
Files: hawtjni-example/pom.xml
hawtjni-generator/pom.xml
hawtjni-maven-plugin/*
hawtjni-runtime/pom.xml
hawtjni-website/*
maven-hawtjni-plugin/*
Copyright: 2009-2014, FuseSource Corp
License: Apache-2.0
......
......@@ -28,6 +28,6 @@
pom.xml --no-parent --has-package-version
hawtjni-runtime/pom.xml --has-package-version
hawtjni-generator/pom.xml --has-package-version --package=libhawtjni-generator-java
maven-hawtjni-plugin/pom.xml --has-package-version --package=libhawtjni-maven-plugin-java
hawtjni-maven-plugin/pom.xml --has-package-version --package=libhawtjni-maven-plugin-java
hawtjni-example/pom.xml --ignore
hawtjni-website/pom.xml --ignore
Description: Generate the component descriptor with plexus-component-metadata instead of plexus-maven-plugin
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/maven-hawtjni-plugin/pom.xml
+++ b/maven-hawtjni-plugin/pom.xml
@@ -133,6 +133,18 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-metadata</artifactId>
+ <executions>
+ <execution>
+ <id>process-classes</id>
+ <goals>
+ <goal>generate-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
01-plexus-component-metadata.patch
......@@ -21,7 +21,7 @@
<parent>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>hawtjni-project</artifactId>
<version>1.15</version>
<version>1.16</version>
</parent>
<artifactId>hawtjni-example</artifactId>
......@@ -61,8 +61,8 @@
<plugin>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>maven-hawtjni-plugin</artifactId>
<version>1.15</version>
<artifactId>hawtjni-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<goals>
......@@ -127,7 +127,7 @@
<plugins>
<plugin>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>maven-hawtjni-plugin</artifactId>
<artifactId>hawtjni-maven-plugin</artifactId>
<configuration>
<osgiPlatforms>
<osgiPlatform>osname=MacOS;processor=x86-64</osgiPlatform>
......
......@@ -21,7 +21,7 @@
<parent>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>hawtjni-project</artifactId>
<version>1.15</version>
<version>1.16</version>
</parent>
<artifactId>hawtjni-generator</artifactId>
......
......@@ -21,10 +21,10 @@
<parent>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>hawtjni-project</artifactId>
<version>1.15</version>
<version>1.16</version>
</parent>
<artifactId>maven-hawtjni-plugin</artifactId>
<artifactId>hawtjni-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>HawtJNI Maven Plugin</name>
......@@ -117,38 +117,52 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5</version>
<scope>provided</scope><!-- annotations are needed only to build the plugin -->
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-maven-plugin</artifactId>
<version>1.3.8</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.5</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<executions>
<execution>
<id>default-descriptor</id>
<phase>process-classes</phase>
</execution>
<!-- if you want to generate help goal -->
<execution>
<id>help-goal</id>
<goals>
<goal>descriptor</goal>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<tagletArtifacts>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
<version>3.5</version>
</tagletArtifact>
</tagletArtifacts>
</configuration>
<artifactId>maven-plugin-plugin</artifactId>
</plugin>
</plugins>
</build>
</reporting>
</project>
......@@ -30,6 +30,10 @@ import org.apache.maven.model.Dependency;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.manager.ArchiverManager;
......@@ -44,76 +48,56 @@ import org.fusesource.hawtjni.runtime.Library;
* to the test resource path so that unit tests can load
* the freshly built JNI library.
*
* @goal build
* @phase generate-test-resources
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
*/
@Mojo(name = "build", defaultPhase = LifecyclePhase.GENERATE_TEST_RESOURCES)
public class BuildMojo extends AbstractMojo {
/**
* The maven project.
*
* @parameter expression="${project}"
* @required
* @readonly
*/
@Parameter(defaultValue = "${project}", readonly = true)
protected MavenProject project;
/**
* Remote repositories
*
* @parameter expression="${project.remoteArtifactRepositories}"
* @required
* @readonly
*/
@Parameter(defaultValue = "${project.remoteArtifactRepositories}", readonly = true)
protected List remoteArtifactRepositories;
/**
* Local maven repository.
*
* @parameter expression="${localRepository}"
* @required
* @readonly
*/
@Parameter(defaultValue = "${localRepository}", readonly = true)
protected ArtifactRepository localRepository;
/**
* Artifact factory, needed to download the package source file
*
* @component role="org.apache.maven.artifact.factory.ArtifactFactory"
* @required
* @readonly
*/
@Component
protected ArtifactFactory artifactFactory;
/**
* Artifact resolver, needed to download the package source file
*
* @component role="org.apache.maven.artifact.resolver.ArtifactResolver"
* @required
* @readonly
*/
@Component
protected ArtifactResolver artifactResolver;
/**
* @component
* @required
* @readonly
*/
@Component
private ArchiverManager archiverManager;
/**
* The base name of the library, used to determine generated file names.
*
* @parameter default-value="${project.artifactId}"
*/
@Parameter(defaultValue = "${project.artifactId}")
private String name;
/**
* Where the unpacked build package is located.
*
* @parameter default-value="${project.build.directory}/generated-sources/hawtjni/native-package"
*/
@Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/native-package")
private File packageDirectory;
/**
......@@ -122,121 +106,105 @@ public class BuildMojo extends AbstractMojo {
*
* The library will placed under the META-INF/native/${platform} directory that the HawtJNI
* Library uses to find JNI libraries as classpath resources.
*
* @parameter default-value="${project.build.directory}/generated-sources/hawtjni/lib"
*/
@Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/lib")
private File libDirectory;
/**
* The directory where the build will be produced. It creates a native-build and native-dist directory
* under the specified directory.
*
* @parameter default-value="${project.build.directory}"
*/
@Parameter(defaultValue = "${project.build.directory}")
private File buildDirectory;
/**
* Should we skip executing the autogen.sh file.
*
* @parameter default-value="${skip-autogen}"
*/
@Parameter(defaultValue = "${skip-autogen}")
private boolean skipAutogen;
/**
* Should we force executing the autogen.sh file.
*
* @parameter default-value="${force-autogen}"
*/
@Parameter(defaultValue = "${force-autogen}")
private boolean forceAutogen;
/**
* Extra arguments you want to pass to the autogen.sh command.
*
* @parameter
*/
@Parameter
private List<String> autogenArgs;
/**
* Should we skip executing the configure command.
*
* @parameter default-value="${skip-configure}"
*/
@Parameter(defaultValue = "${skip-configure}")
private boolean skipConfigure;
/**
* Should we force executing the configure command.
*
* @parameter default-value="${force-configure}"
*/
@Parameter(defaultValue = "${force-configure}")
private boolean forceConfigure;
/**
* Should we display all the native build output?
*
* @parameter default-value="${hawtjni-verbose}"
*/
@Parameter(defaultValue = "${hawtjni-verbose}")
private boolean verbose;
/**
* Extra arguments you want to pass to the configure command.
*
* @parameter
*/
@Parameter
private List<String> configureArgs;
/**
* The platform identifier of this build. If not specified,
* it will be automatically detected.
*
* @parameter
*/
@Parameter
private String platform;
/**
* The classifier of the package archive that will be created.
*
* @parameter default-value="native-src"
*/
@Parameter(defaultValue = "native-src")
private String sourceClassifier;
/**
* If the source build could not be fully generated, perhaps the autotools
* were not available on this platform, should we attempt to download
* a previously deployed source package and build that?
*
* @parameter default-value="true"
*/
@Parameter(defaultValue = "true")
private boolean downloadSourcePackage = true;
/**
* The dependency to download to get the native sources.
*
* @parameter
*/
@Parameter
private Dependency nativeSrcDependency;
/**
* URL to where we can down the source package
*
* @parameter default-value="${native-src-url}"
*/
@Parameter(defaultValue = "${native-src-url}")
private String nativeSrcUrl;
/**
* The build tool to use on Windows systems. Set
* to 'msbuild', 'vcbuild', or 'detect'
*
* @parameter default-value="detect"
*/
@Parameter(defaultValue = "detect")
private String windowsBuildTool;
/**
* The name of the msbuild/vcbuild project to use.
* Defaults to 'vs2010' for 'msbuild'
* and 'vs2008' for 'vcbuild'.
*
* @parameter
*/
@Parameter
private String windowsProjectName;
private final CLI cli = new CLI();
......@@ -276,7 +244,7 @@ public class BuildMojo extends AbstractMojo {
} else if( "windows64".equals(libPlatform) ) {
platform = "x64";
} else {
throw new MojoExecutionException("Usupported platform: "+libPlatform);
throw new MojoExecutionException("Unsupported platform: "+libPlatform);
}
boolean useMSBuild = false;
......
......@@ -29,6 +29,9 @@ import java.util.Set;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.interpolation.InterpolatorFilterReader;
import org.codehaus.plexus.interpolation.MapBasedValueSource;
......@@ -44,138 +47,118 @@ import org.fusesource.hawtjni.generator.ProgressMonitor;
* build a JNI library for any HawtJNI annotated
* classes in your maven project.
*
* @goal generate
* @phase process-classes
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
*/
@Mojo(name = "generate", defaultPhase = LifecyclePhase.PROCESS_CLASSES)
public class GenerateMojo extends AbstractMojo {
/**
* The maven project.
*
* @parameter expression="${project}"
* @required
* @readonly
*/
@Parameter(defaultValue = "${project}", readonly = true)
protected MavenProject project;
/**
* The directory where the native source files are located.
*
* @parameter
*/
@Parameter
private File nativeSourceDirectory;
/**
* The directory where the generated native source files are located.
*
* @parameter default-value="${project.build.directory}/generated-sources/hawtjni/native-src"
*/
@Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/native-src")
private File generatedNativeSourceDirectory;
/**
* The base name of the library, used to determine generated file names.
*
* @parameter default-value="${project.artifactId}"
*/
@Parameter(defaultValue = "${project.artifactId}")
private String name;
/**
* The copyright header template that will be added to the generated source files.
* Use the '%END_YEAR%' token to have it replaced with the current year.
*
* @parameter default-value=""
*/
@Parameter(defaultValue = "")
private String copyright;
/**
* Restrict looking for JNI classes to the specified package.
*
* @parameter
*/
@Parameter
private List<String> packages = new ArrayList<String>();
/**
* The directory where the java classes files are located.
*
* @parameter default-value="${project.build.outputDirectory}"
*/
@Parameter(defaultValue = "${project.build.outputDirectory}")
private File classesDirectory;
/**
* The directory where the generated build package is located..
*
* @parameter default-value="${project.build.directory}/generated-sources/hawtjni/native-package"
*/
@Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/native-package")
private File packageDirectory;
/**
* The list of additional files to be included in the package will be
* placed.
*
* @parameter default-value="${basedir}/src/main/native-package"
*/
@Parameter(defaultValue = "${basedir}/src/main/native-package")
private File customPackageDirectory;
/**
* The text encoding of the files.
*
* @parameter default-value="UTF-8"
*/
@Parameter(defaultValue = "UTF-8")
private String encoding;
/**
* Should we skip executing the autogen.sh file.
*
* @parameter default-value="${skip-autogen}"
*/
@Parameter(defaultValue = "${skip-autogen}")
private boolean skipAutogen;
/**
* Should we force executing the autogen.sh file.
*
* @parameter default-value="${force-autogen}"
*/
@Parameter(defaultValue = "${force-autogen}")
private boolean forceAutogen;
/**
* Should we display all the native build output?
*
* @parameter default-value="${hawtjni-verbose}"
*/
@Parameter(defaultValue = "${hawtjni-verbose}")
private boolean verbose;
/**
* Extra arguments you want to pass to the autogen.sh command.
*
* @parameter
*/
@Parameter
private List<String> autogenArgs;
/**
* Set this value to false to disable the callback support in HawtJNI.
* Disabling callback support can substantially reduce the size
* of the generated native library.
*
* @parameter default-value="true"
*/
@Parameter(defaultValue = "true")
private boolean callbacks;
/**
* The build tool to use on Windows systems. Set
* to 'msbuild', 'vcbuild', or 'detect'
*
* @parameter default-value="detect"
*/
@Parameter(defaultValue = "detect")
private String windowsBuildTool;
/**
* The name of the msbuild/vcbuild project to use.
* Defaults to 'vs2010' for 'msbuild'
* and 'vs2008' for 'vcbuild'.
*
* @parameter
*/
@Parameter
private String windowsProjectName;
private File targetSrcDir;
......
......@@ -21,6 +21,10 @@ import java.util.List;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.plexus.archiver.jar.JarArchiver;
......@@ -37,40 +41,31 @@ import org.fusesource.hawtjni.runtime.Library;
* This platform specific jar is attached with a classifier which matches the
* current platform.
*
* @goal package-jar
* @phase prepare-package
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
*/
@Mojo(name = "package-jar", defaultPhase = LifecyclePhase.PREPARE_PACKAGE)
public class PackageJarMojo extends AbstractMojo {
/**
* The maven project.
*
* @parameter expression="${project}"
* @required
* @readonly
*/
@Parameter(defaultValue = "${project}", readonly = true)
protected MavenProject project;
/**
* The base name of the library, used to determine generated file names.
*
* @parameter default-value="${project.artifactId}"
*/
@Parameter(defaultValue = "${project.artifactId}")
private String name;
/**
* @component
* @required
* @readonly
*/
@Component
private ArchiverManager archiverManager;
/**
* @component
* @required
* @readonly
*/
@Component
private MavenProjectHelper projectHelper;
/**
......@@ -81,10 +76,8 @@ public class PackageJarMojo extends AbstractMojo {
* The library will placed under the META-INF/native/${platform} directory
* that the HawtJNI Library uses to find JNI libraries as classpath
* resources.
*
* @parameter
* default-value="${project.build.directory}/generated-sources/hawtjni/lib"
*/
@Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/lib")
private File libDirectory;
/**
......@@ -93,22 +86,21 @@ public class PackageJarMojo extends AbstractMojo {
*
* @parameter
*/
@Parameter
private String platform;
/**
* Should a classifier of the native jar be set
* to match the platform?
*
* @parameter default-value="true"
*/
@Parameter(defaultValue = "true")
private boolean classified;
/**
* The osgi platforms that the library match for. Example value:
* osname=MacOS;processor=x86-64
*
* @parameter
*/
@Parameter
private List<String> osgiPlatforms;
public void execute() throws MojoExecutionException {
......
......@@ -20,6 +20,10 @@ import java.io.File;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.plexus.archiver.Archiver;
......@@ -30,54 +34,43 @@ import org.codehaus.plexus.archiver.manager.ArchiverManager;
* module and attaches it to the build so that it can get
* deployed.
*
* @goal package-source
* @phase package
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
*/
@Mojo(name = "package-source", defaultPhase = LifecyclePhase.PACKAGE)
public class PackageSourceMojo extends AbstractMojo {
/**
* The maven project.
*
* @parameter expression="${project}"
* @required
* @readonly
*/
@Parameter(defaultValue = "${project}", readonly = true)
protected MavenProject project;
/**
* @component
* @required
* @readonly
*/
@Component
private ArchiverManager archiverManager;
/**
* @component
* @required
* @readonly
*/
@Component
private MavenProjectHelper projectHelper;
/**
* The directory where the generated native files are located..
*
* @parameter default-value="${project.build.directory}/generated-sources/hawtjni/native-package"
*/
@Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/native-package")
private File packageDirectory;
/**
* The classifier of the package archive that will be created.
*
* @parameter default-value="native-src"
*/
@Parameter(defaultValue = "native-src")
private String sourceClassifier;
/**
* Should we skip executing the autogen.sh file.
*
* @parameter default-value="${skip-autogen}"
*/
@Parameter(defaultValue = "${skip-autogen}")
private boolean skipAutogen;
......@@ -96,7 +89,7 @@ public class PackageSourceMojo extends AbstractMojo {
getLog().info("");
getLog().warn("Will NOT package the native sources to: "+packageFile);
getLog().info(" Native source build directory did not contain a 'configure' script.");
getLog().info(" To ignore this warnning and package it up anyways configure the plugin with: <skipAutogen>true</skipAutogen>");
getLog().info(" To ignore this warning and package it up anyways, configure the plugin with: <skipAutogen>true</skipAutogen>");
getLog().info("");
return;
}
......