Browse Source

Generate sources with release profile

This patch refactors how unpacking of dependencies is handled.
It now uses a more generic configuration on top level as well as
updates the phase where the extraction happens. This way the source
plugin configuration remains small

Change-Id: I952ec84e05eac255f8b44044baceba37e07737c5
tags/7.7.0.alpha1
Teemu Suo-Anttila 8 years ago
parent
commit
f776982842

+ 0
- 1
all/pom.xml View File

<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions> <executions>
<execution> <execution>
<phase>initialize</phase> <phase>initialize</phase>

+ 12
- 0
buildhelpers/pom.xml View File

</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

<!-- Skip sources jar -->
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<skipSource>true</skipSource>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build> </build>
</project> </project>

+ 2
- 6
client-compiler/pom.xml View File

<executions> <executions>
<execution> <execution>
<id>unpack-dependencies</id> <id>unpack-dependencies</id>
<phase>process-classes</phase>
<phase>generate-resources</phase>
<goals> <goals>
<goal>unpack</goal> <goal>unpack</goal>
</goals> </goals>
</excludes> </excludes>
</artifactItem> </artifactItem>
</artifactItems> </artifactItems>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
<goal>copy-resources</goal> <goal>copy-resources</goal>
</goals> </goals>
<configuration> <configuration>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources> <resources>
<resource> <resource>
<directory>src/main/java</directory> <directory>src/main/java</directory>
</plugins> </plugins>
</build> </build>
<!--todo .javadoc.jar file --> <!--todo .javadoc.jar file -->
<!--todo .sources.java -->
</project> </project>

+ 3
- 6
client/pom.xml View File

<version>${javax.validation.version}</version> <version>${javax.validation.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.validation</groupId> <groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId> <artifactId>validation-api</artifactId>
<executions> <executions>
<execution> <execution>
<id>unpack-dependencies</id> <id>unpack-dependencies</id>
<phase>prepare-package</phase>
<phase>generate-resources</phase>
<goals> <goals>
<goal>unpack</goal> <goal>unpack</goal>
</goals> </goals>
<excludes>META-INF/**</excludes> <excludes>META-INF/**</excludes>
</artifactItem> </artifactItem>
</artifactItems> </artifactItems>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
<goal>copy-resources</goal> <goal>copy-resources</goal>
</goals> </goals>
<configuration> <configuration>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>

+ 1
- 1
liferay/liferay-assembly-descriptor.xml View File

<fileSets> <fileSets>
<fileSet> <fileSet>
<outputDirectory/> <outputDirectory/>
<directory>${project.build.directory}/dependency</directory>
<directory>${dependency.unpack.directory}</directory>
<includes> <includes>
<include>**</include> <include>**</include>
</includes> </includes>

+ 1
- 1
liferay/pom.xml View File

<executions> <executions>
<execution> <execution>
<id>unpack</id> <id>unpack</id>
<phase>prepare-package</phase>
<phase>generate-resources</phase>
<goals> <goals>
<goal>unpack</goal> <goal>unpack</goal>
</goals> </goals>

+ 67
- 0
pom.xml View File

<!-- Atmosphere versions --> <!-- Atmosphere versions -->
<atmosphere.runtime.version>2.2.7.vaadin1</atmosphere.runtime.version> <atmosphere.runtime.version>2.2.7.vaadin1</atmosphere.runtime.version>
<atmosphere.js.version>2.2.6.vaadin4</atmosphere.js.version> <atmosphere.js.version>2.2.6.vaadin4</atmosphere.js.version>

<!-- Dependency unpack directory -->
<dependency.unpack.directory>${project.build.directory}/dependency-unpack</dependency.unpack.directory>
</properties> </properties>


<!-- TODO: remove this after maven plugin has been released --> <!-- TODO: remove this after maven plugin has been released -->
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<!-- Downgraded due to filtering related bug -->
<version>2.6</version> <version>2.6</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version> <version>2.10</version>
<configuration>
<outputDirectory>${dependency.unpack.directory}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version> <version>1.4.0</version>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>

<plugins>
<!-- Unpacked Dependencies as resource -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>

<!-- Needs extra resource folder for unpacked dependencies -->
<executions>
<execution>
<id>add-dependency-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${dependency.unpack.directory}</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build> </build>


<profiles> <profiles>
<properties> <properties>
<vaadin.plugin.version>${project.version}</vaadin.plugin.version> <vaadin.plugin.version>${project.version}</vaadin.plugin.version>
</properties> </properties>
<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>sources-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- Only include java files -->
<includes>
<include>**/*.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile> </profile>
</profiles> </profiles>



+ 2
- 6
server/pom.xml View File



<build> <build>
<plugins> <plugins>

<!-- Copy needed GWT dependencies to package --> <!-- Copy needed GWT dependencies to package -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<executions> <executions>
<execution> <execution>
<id>unpack-dependencies</id> <id>unpack-dependencies</id>
<phase>prepare-package</phase>
<phase>generate-resources</phase>
<goals> <goals>
<goal>unpack</goal> <goal>unpack</goal>
</goals> </goals>
</artifactItem> </artifactItem>
</artifactItems> </artifactItems>
<includes>com/google/gwt/*/server/**</includes> <includes>com/google/gwt/*/server/**</includes>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
<goal>copy-resources</goal> <goal>copy-resources</goal>
</goals> </goals>
<configuration> <configuration>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>

+ 2
- 6
shared/pom.xml View File

<executions> <executions>
<execution> <execution>
<id>unpack-dependencies</id> <id>unpack-dependencies</id>
<phase>prepare-package</phase>
<phase>generate-resources</phase>
<goals> <goals>
<goal>unpack</goal> <goal>unpack</goal>
</goals> </goals>
</includes> </includes>
</artifactItem> </artifactItem>
</artifactItems> </artifactItems>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>



<plugin> <plugin>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<executions> <executions>
<goal>copy-resources</goal> <goal>copy-resources</goal>
</goals> </goals>
<configuration> <configuration>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources> <resources>
<resource> <resource>
<directory>src/main/java</directory> <directory>src/main/java</directory>

+ 2
- 2
shared/src/main/java-templates/com/vaadin/shared/Version.java View File



/* Initialize version numbers from string replaced by build-script. */ /* Initialize version numbers from string replaced by build-script. */
static { static {
if ("${vaadin.version}".equals("${" + "vaadin.version" + "}")) {
if ("${project.version}".equals("${" + "project.version" + "}")) {
VERSION = "9.9.9.INTERNAL-DEBUG-BUILD"; VERSION = "9.9.9.INTERNAL-DEBUG-BUILD";
} else { } else {
VERSION = "${vaadin.version}";
VERSION = "${project.version}";
} }
final String[] digits = VERSION.split("\\.", 4); final String[] digits = VERSION.split("\\.", 4);
VERSION_MAJOR = Integer.parseInt(digits[0]); VERSION_MAJOR = Integer.parseInt(digits[0]);

+ 8
- 1
themes/pom.xml View File



<pluginManagement> <pluginManagement>
<plugins> <plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<skipSource>true</skipSource>
</configuration>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>

+ 0
- 3
uitest/pom.xml View File

<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-clean-plugin</artifactId> <artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<configuration> <configuration>
<filesets> <filesets>
<fileset> <fileset>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId> <artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
<configuration> <configuration>
<skip>true</skip> <skip>true</skip>
</configuration> </configuration>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<configuration> <configuration>
<skip>true</skip> <skip>true</skip>
</configuration> </configuration>

+ 3
- 7
widgets/pom.xml View File

<executions> <executions>
<execution> <execution>
<id>unpack-dependencies</id> <id>unpack-dependencies</id>
<phase>prepare-package</phase>
<phase>generate-resources</phase>
<goals> <goals>
<goal>unpack</goal> <goal>unpack</goal>
</goals> </goals>
<outputDirectory>${project.build.directory}/themes</outputDirectory> <outputDirectory>${project.build.directory}/themes</outputDirectory>
</artifactItem> </artifactItem>
</artifactItems> </artifactItems>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
<goal>copy-resources</goal> <goal>copy-resources</goal>
</goals> </goals>
<configuration> <configuration>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources> <resources>
<resource> <resource>
<directory>src/main/java</directory> <directory>src/main/java</directory>
<goal>copy-resources</goal> <goal>copy-resources</goal>
</goals> </goals>
<configuration> <configuration>
<outputDirectory>${project.build.directory}/classes/com/vaadin/themes/public
</outputDirectory>
<outputDirectory>${project.build.outputDirectory}/com/vaadin/themes/public</outputDirectory>
<resources> <resources>
<resource> <resource>
<directory>${project.build.directory}/themes/VAADIN/themes</directory> <directory>${project.build.directory}/themes/VAADIN/themes</directory>

Loading…
Cancel
Save