Browse Source

it seems to me that properties-maven-plugin doesn't work with maven 3

pull/3/head
Decebal Suiu 12 years ago
parent
commit
363b2b093c
  1. 118
      demo/plugin1/pom.xml
  2. 56
      demo/plugin2/pom.xml
  3. 13
      demo/pom.xml
  4. 62
      pom.xml

118
demo/plugin1/pom.xml

@ -21,47 +21,58 @@
</license> </license>
</licenses> </licenses>
<properties>
<plugin.id>welcome-plugin</plugin.id>
<plugin.class>ro.fortsoft.pf4j.demo.welcome.WelcomePlugin</plugin.class>
<plugin.version>0.0.1</plugin.version>
<plugin.provider>Decebal Suiu</plugin.provider>
<plugin.dependencies></plugin.dependencies>
</properties>
<build> <build>
<plugins> <plugins>
<!-- DOESN'T WORK WITH MAVEN 3 (I defined the plugin metadata in properties section)
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId> <artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version> <version>1.0-alpha-2</version>
<executions> <executions>
<execution> <execution>
<phase>initialize</phase> <phase>initialize</phase>
<goals> <goals>
<goal>read-project-properties</goal> <goal>read-project-properties</goal>
</goals> </goals>
<configuration> <configuration>
<files> <files>
<file>plugin.properties</file> <file>plugin.properties</file>
</files> </files>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId> <plugin>
<artifactId>maven-antrun-plugin</artifactId> <groupId>org.apache.maven.plugins</groupId>
<version>1.6</version> <artifactId>maven-antrun-plugin</artifactId>
<executions> <version>1.6</version>
<execution> <executions>
<id>unzip jar file</id> <execution>
<phase>package</phase> <id>unzip jar file</id>
<configuration> <phase>package</phase>
<target> <configuration>
<unzip src="target/${artifactId}-${version}.${packaging}" dest="target/plugin-classes" /> <target>
</target> <unzip src="target/${artifactId}-${version}.${packaging}" dest="target/plugin-classes" />
</configuration> </target>
<goals> </configuration>
<goal>run</goal> <goals>
</goals> <goal>run</goal>
</execution> </goals>
</executions> </execution>
</plugin> </executions>
</plugin>
<plugin> <plugin>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version> <version>2.3</version>
@ -84,21 +95,22 @@
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<configuration> <version>2.4</version>
<archive> <configuration>
<manifestEntries> <archive>
<Plugin-Id>${plugin.id}</Plugin-Id> <manifestEntries>
<Plugin-Class>${plugin.class}</Plugin-Class> <Plugin-Id>${plugin.id}</Plugin-Id>
<Plugin-Version>${plugin.version}</Plugin-Version> <Plugin-Class>${plugin.class}</Plugin-Class>
<Plugin-Provider>${plugin.provider}</Plugin-Provider> <Plugin-Version>${plugin.version}</Plugin-Version>
<Plugin-Dependencies>${plugin.dependencies}</Plugin-Dependencies> <Plugin-Provider>${plugin.provider}</Plugin-Provider>
</manifestEntries> <Plugin-Dependencies>${plugin.dependencies}</Plugin-Dependencies>
</archive> </manifestEntries>
</configuration> </archive>
</plugin> </configuration>
</plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>

56
demo/plugin2/pom.xml

@ -20,27 +20,37 @@
<distribution>repo</distribution> <distribution>repo</distribution>
</license> </license>
</licenses> </licenses>
<properties>
<plugin.id>hello-plugin</plugin.id>
<plugin.class>ro.fortsoft.pf4j.demo.hello.HelloPlugin</plugin.class>
<plugin.version>0.0.1</plugin.version>
<plugin.provider>Decebal Suiu</plugin.provider>
<plugin.dependencies></plugin.dependencies>
</properties>
<build> <build>
<plugins> <plugins>
<!-- DOESN'T WORK WITH MAVEN 3 (I defined the plugin metadata in properties section)
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId> <artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version> <version>1.0-alpha-2</version>
<executions> <executions>
<execution> <execution>
<phase>initialize</phase> <phase>initialize</phase>
<goals> <goals>
<goal>read-project-properties</goal> <goal>read-project-properties</goal>
</goals> </goals>
<configuration> <configuration>
<files> <files>
<file>plugin.properties</file> <file>plugin.properties</file>
</files> </files>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
-->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
@ -66,28 +76,19 @@
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version> <version>2.3</version>
<configuration> <configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors> <descriptors>
<descriptor> <descriptor>
src/main/assembly/assembly.xml src/main/assembly/assembly.xml
</descriptor> </descriptor>
</descriptors> </descriptors>
<archive> <appendAssemblyId>false</appendAssemblyId>
<manifestEntries>
<Plugin-Id>${plugin.id}</Plugin-Id>
<Plugin-Class>${plugin.class}</Plugin-Class>
<Plugin-Version>${plugin.version}</Plugin-Version>
<Plugin-Provider>${plugin.provider}</Plugin-Provider>
<Plugin-Dependencies>${plugin.dependencies}</Plugin-Dependencies>
</manifestEntries>
</archive>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
<id>make-assembly</id> <id>make-assembly</id>
<phase>package</phase> <phase>package</phase>
<goals> <goals>
<goal>single</goal> <goal>attached</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
@ -96,6 +97,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration> <configuration>
<archive> <archive>
<manifestEntries> <manifestEntries>

13
demo/pom.xml

@ -35,19 +35,6 @@
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
</resource> </resource>
</resources> </resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<optimize>true</optimize>
</configuration>
</plugin>
</plugins>
</build> </build>
<modules> <modules>

62
pom.xml

@ -2,10 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>org.sonatype.oss</groupId> <groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId> <artifactId>oss-parent</artifactId>
<version>7</version> <version>7</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>ro.fortsoft.pf4j</groupId> <groupId>ro.fortsoft.pf4j</groupId>
@ -48,28 +48,30 @@
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<executions> <version>2.8</version>
<execution> <executions>
<goals> <execution>
<goal>jar</goal> <goals>
</goals> <goal>jar</goal>
</execution> </goals>
</executions> </execution>
</plugin> </executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<executions> <version>2.2</version>
<execution> <executions>
<goals> <execution>
<goal>jar</goal> <goals>
</goals> <goal>jar</goal>
</execution> </goals>
</executions> </execution>
</plugin> </executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
@ -89,15 +91,15 @@
<plugin> <plugin>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version> <version>2.4</version>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<modules> <modules>
<module>pf4j</module> <module>pf4j</module>
<module>demo</module> <module>demo</module>
</modules> </modules>
<profiles> <profiles>
<profile> <profile>

Loading…
Cancel
Save