Update to use new version of OneDev maven plugin

This commit is contained in:
Robin Shen 2019-06-06 20:14:55 +08:00
parent 803ff377a6
commit cd99461221
3488 changed files with 353 additions and 344 deletions

78
pom.xml
View File

@ -4,10 +4,10 @@
<parent> <parent>
<groupId>io.onedev</groupId> <groupId>io.onedev</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>1.0.2</version> <version>1.0.3</version>
</parent> </parent>
<artifactId>server</artifactId> <artifactId>server</artifactId>
<version>2.1.4</version> <version>3.0.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<build> <build>
<finalName>${project.groupId}.${project.artifactId}-${project.version}</finalName> <finalName>${project.groupId}.${project.artifactId}-${project.version}</finalName>
@ -41,13 +41,9 @@
<pluginExecutionFilter> <pluginExecutionFilter>
<groupId>io.onedev</groupId> <groupId>io.onedev</groupId>
<artifactId>plugin-maven</artifactId> <artifactId>plugin-maven</artifactId>
<versionRange>[1.0.3,]</versionRange> <versionRange>[2.0.0,]</versionRange>
<goals> <goals>
<goal>generate-artifact-descriptor</goal> <goal>populate-resources</goal>
<goal>generate-plugin-descriptor</goal>
<goal>generate-product-descriptor</goal>
<goal>copy-product-resources</goal>
<goal>create-product-sandbox</goal>
</goals> </goals>
</pluginExecutionFilter> </pluginExecutionFilter>
<action> <action>
@ -104,43 +100,31 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>io.onedev</groupId>
<artifactId>plugin-maven</artifactId>
<version>1.0.3</version>
<executions>
<execution>
<id>generate-artifact-descriptor</id>
<phase>compile</phase>
<goals>
<goal>generate-artifact-descriptor</goal>
</goals>
</execution>
<execution>
<id>generate-plugin-descriptor</id>
<phase>compile</phase>
<goals>
<goal>generate-plugin-descriptor</goal>
</goals>
</execution>
<execution>
<id>create-product-sandbox</id>
<phase>compile</phase>
<goals>
<goal>create-product-sandbox</goal>
</goals>
</execution>
<execution>
<id>package-artifact</id>
<phase>package</phase>
<goals>
<goal>package-artifact</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins>
<plugin>
<groupId>io.onedev</groupId>
<artifactId>plugin-maven</artifactId>
<version>2.0.0</version>
<executions>
<execution>
<id>populate-resources</id>
<phase>compile</phase>
<goals>
<goal>populate-resources</goal>
</goals>
</execution>
<execution>
<id>package-artifacts</id>
<phase>package</phase>
<goals>
<goal>package-artifacts</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources> <resources>
<resource> <resource>
<directory>src/main/java</directory> <directory>src/main/java</directory>
@ -160,9 +144,9 @@
</resources> </resources>
</build> </build>
<modules> <modules>
<module>core</module> <module>server-core</module>
<module>plugin</module> <module>server-plugin</module>
<module>product</module> <module>server-product</module>
</modules> </modules>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
@ -211,7 +195,7 @@
</repository> </repository>
</repositories> </repositories>
<properties> <properties>
<commons.version>1.0.14</commons.version> <commons.version>1.1.0</commons.version>
<antlr.version>4.7.2</antlr.version> <antlr.version>4.7.2</antlr.version>
</properties> </properties>
</project> </project>

View File

@ -1,13 +0,0 @@
target(default:"package the product") {
File buildDir = new File("${buildDirectory}");
File sandboxDir = new File(buildDir, "sandbox");
// do not change this line of code
chmod(dir: sandboxDir, perm: "755", includes: "${executables}")
File destFile = new File(buildDir, "onedev-${productVersion}.zip");
zip(destfile: destFile) {
zipfileset(dir: sandboxDir, prefix: "onedev-${productVersion}", excludes: "${executables}, boot/system.classpath, site/lib/*.jar")
zipfileset(dir: sandboxDir, prefix: "onedev-${productVersion}", includes: "${executables}", filemode: "755")
}
}

View File

@ -1,142 +0,0 @@
target(default:"prepare to package the product") {
File buildDir = new File("${buildDirectory}")
File sandboxDir = new File(buildDir, "sandbox")
echo(file: new File(sandboxDir, "version.txt"), message: "${productVersion}")
File jswLoc = new File(buildDir, "jsw")
unzip(src: new File("${jswPath}/wrapper-delta-pack-st.zip"), dest: jswLoc, overwrite: true) {
regexpmapper(from: "^.*?/(.*)", to:"\\1")
}
File binDir = new File(sandboxDir, "bin")
File bootDir = new File(sandboxDir, "boot")
copy(todir: bootDir) {
fileset(dir: jswLoc.absolutePath + "/bin", includes: "wrapper-*")
fileset(dir: jswLoc.absolutePath + "/lib", includes: "libwrapper-*, *.dll, wrapper.jar")
}
filterset(id: "appFilterSet") {
filter(token: "app.name", value: "onedev")
filter(token: "app.long.name", value: "OneDev")
filter(token: "app.description", value: "OneDev")
filter(token: "app.class", value: "${bootstrapClass}")
}
filterset(id: "batchCommandCommonFilterSet") {
filter(token: "set_fixed_command", value: "set _FIXED_COMMAND=console")
}
filterset(id: "shellScriptCommonFilterSet") {
filter(token: "set_fixed_command", value: "FIXED_COMMAND=console")
filter(token: "set_pass_through", value: "PASS_THROUGH=true")
}
copy(tofile: binDir.absolutePath + "/server.bat", file: "${jswPath}/AppCommand.bat.in") {
filterset() {
filter(token: "set_fixed_command", value: "")
filter(token: "properties_and_parameters", value: "wrapper.pidfile=../status/onedev.pid")
}
}
copy(tofile: binDir.absolutePath + "/restore.bat", file: "${jswPath}/AppCommand.bat.in") {
filterset(refid: "batchCommandCommonFilterSet")
filterset() {
filter(token: "properties_and_parameters", value: "wrapper.logfile.loglevel=NONE wrapper.console.title=\"OneDev Restore\" wrapper.pidfile=onedev_restore.pid wrapper.name=onedev_restore wrapper.displayname=\"OneDev Restore\" wrapper.description=\"OneDev Restore\" -- restore")
}
}
copy(tofile: binDir.absolutePath + "/backup.bat", file: "${jswPath}/AppCommand.bat.in") {
filterset(refid: "batchCommandCommonFilterSet")
filterset() {
filter(token: "properties_and_parameters", value: "wrapper.logfile.loglevel=NONE wrapper.console.title=\"OneDev Backup\" wrapper.pidfile=onedev_backup.pid wrapper.name=onedev_backup wrapper.displayname=\"OneDev Backup\" wrapper.description=\"OneDev Backup\" -- backup")
}
}
copy(tofile: binDir.absolutePath + "/upgrade.bat", file: "${jswPath}/AppCommand.bat.in") {
filterset(refid: "batchCommandCommonFilterSet")
filterset() {
filter(token: "properties_and_parameters", value: "wrapper.logfile.loglevel=NONE wrapper.console.title=\"OneDev Upgrade\" wrapper.pidfile=onedev_upgrade.pid wrapper.name=onedev_upgrade wrapper.displayname=\"OneDev Upgrade\" wrapper.description=\"OneDev Upgrade\" -- upgrade")
}
}
copy(tofile: binDir.absolutePath + "/apply_db_constraints.bat", file: "${jswPath}/AppCommand.bat.in") {
filterset(refid: "batchCommandCommonFilterSet")
filterset() {
filter(token: "properties_and_parameters", value: "wrapper.logfile.loglevel=NONE wrapper.console.title=\"OneDev Apply DB Constraints\" wrapper.pidfile=onedev_apply_db_constraints.pid wrapper.name=onedev_apply_db_constraints wrapper.displayname=\"OneDev Apply DB Constraints\" wrapper.description=\"OneDev Apply DB Constraints\" -- apply_db_constraints")
}
}
copy(tofile: binDir.absolutePath + "/reset_admin_password.bat", file: "${jswPath}/AppCommand.bat.in") {
filterset(refid: "batchCommandCommonFilterSet")
filterset() {
filter(token: "properties_and_parameters", value: "wrapper.logfile.loglevel=NONE wrapper.console.title=\"OneDev Reset Admin Password\" wrapper.pidfile=onedev_reset_admin_password.pid wrapper.name=onedev_reset_admin_password wrapper.displayname=\"OneDev Reset Admin Password\" wrapper.description=\"OneDev Reset Admin Password\" -- reset_admin_password")
}
}
copy(tofile: binDir.absolutePath + "/server.sh", file: "${jswPath}/sh.script.in") {
filterset(refid: "appFilterSet")
filterset() {
filter(token: "set_fixed_command", value: "")
filter(token: "set_pass_through", value: "")
filter(token: "properties_and_parameters", value: "--")
}
}
copy(tofile: binDir.absolutePath + "/restore.sh", file: "${jswPath}/sh.script.in") {
filterset() {
filter(token: "app.name", value: "onedev_restore")
filter(token: "app.long.name", value: "OneDev Restore")
filter(token: "app.description", value: "OneDev Restore")
filter(token: "app.class", value: "${bootstrapClass}")
}
filterset(refid: "shellScriptCommonFilterSet")
filterset() {
filter(token: "properties_and_parameters", value: "wrapper.logfile.loglevel=NONE wrapper.console.title='OneDev Restore' wrapper.name=onedev_restore wrapper.displayname='OneDev Restore' wrapper.description='OneDev Restore' -- restore")
}
}
copy(tofile: binDir.absolutePath + "/backup.sh", file: "${jswPath}/sh.script.in") {
filterset() {
filter(token: "app.name", value: "onedev_backup")
filter(token: "app.long.name", value: "OneDev Backup")
filter(token: "app.description", value: "OneDev Backup")
filter(token: "app.class", value: "${bootstrapClass}")
}
filterset(refid: "shellScriptCommonFilterSet")
filterset() {
filter(token: "properties_and_parameters", value: "wrapper.logfile.loglevel=NONE wrapper.console.title='OneDev Backup' wrapper.name=onedev_backup wrapper.displayname='OneDev Backup' wrapper.description='OneDev Backup' -- backup")
}
}
copy(tofile: binDir.absolutePath + "/upgrade.sh", file: "${jswPath}/sh.script.in") {
filterset() {
filter(token: "app.name", value: "onedev_upgrade")
filter(token: "app.long.name", value: "OneDev Upgrade")
filter(token: "app.description", value: "OneDev Upgrade")
filter(token: "app.class", value: "${bootstrapClass}")
}
filterset(refid: "shellScriptCommonFilterSet")
filterset() {
filter(token: "properties_and_parameters", value: "wrapper.logfile.loglevel=NONE wrapper.console.title='OneDev Upgrade' wrapper.name=onedev_upgrade wrapper.displayname='OneDev Upgrade' wrapper.description='OneDev Upgrade' -- upgrade")
}
}
copy(tofile: binDir.absolutePath + "/apply_db_constraints.sh", file: "${jswPath}/sh.script.in") {
filterset() {
filter(token: "app.name", value: "onedev_apply_db_constraints")
filter(token: "app.long.name", value: "OneDev Apply DB Constraints")
filter(token: "app.description", value: "OneDev Apply DB Constraints")
filter(token: "app.class", value: "${bootstrapClass}")
}
filterset(refid: "shellScriptCommonFilterSet")
filterset() {
filter(token: "properties_and_parameters", value: "wrapper.logfile.loglevel=NONE wrapper.console.title='OneDev Apply DB Constraints' wrapper.name=onedev_apply_db_constraints wrapper.displayname='OneDev Apply DB Constraints' wrapper.description='OneDev Apply DB Constraints' -- apply_db_constraints")
}
}
copy(tofile: binDir.absolutePath + "/reset_admin_password.sh", file: "${jswPath}/sh.script.in") {
filterset() {
filter(token: "app.name", value: "onedev_reset_admin_password")
filter(token: "app.long.name", value: "OneDev Reset Admin Password")
filter(token: "app.description", value: "OneDev Reset Admin Password")
filter(token: "app.class", value: "${bootstrapClass}")
}
filterset(refid: "shellScriptCommonFilterSet")
filterset() {
filter(token: "properties_and_parameters", value: "wrapper.logfile.loglevel=NONE wrapper.console.title='OneDev Reset Admin Password' wrapper.name=onedev_reset_admin_password wrapper.displayname='OneDev Reset Admin Password' wrapper.description='OneDev Reset Admin Password' -- reset_admin_password")
}
}
copy(tofile: sandboxDir.absolutePath + "/conf/wrapper.conf", file: "${jswPath}/wrapper.conf") {
filterset(refid: "appFilterSet")
}
}

View File

@ -1,116 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<artifactId>server-product</artifactId>
<parent>
<groupId>io.onedev</groupId>
<artifactId>server</artifactId>
<version>2.1.4</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>io.onedev</groupId>
<artifactId>plugin-maven</artifactId>
<executions>
<execution>
<id>generate-product-descriptor</id>
<phase>compile</phase>
<goals>
<goal>generate-product-descriptor</goal>
</goals>
</execution>
<execution>
<id>copy-product-resources</id>
<phase>compile</phase>
<goals>
<goal>copy-product-resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-apache-regexp</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>org.codehaus.gant</groupId>
<artifactId>gant_groovy1.8</artifactId>
<version>1.9.7</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>prepare-package</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef name="gant" classname="org.codehaus.gant.ant.Gant"/>
<gant file="build/prepare_package.gant">
<definition name="buildDirectory" value="${project.build.directory}"/>
<definition name="outputDirectory" value="${project.build.outputDirectory}"/>
<definition name="jswPath" value="${basedir}/build/jsw"/>
<definition name="productVersion" value="${project.version}"/>
<definition name="bootstrapClass" value="${bootstrapClass}"/>
</gant>
</target>
</configuration>
</execution>
<execution>
<id>package</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef name="gant" classname="org.codehaus.gant.ant.Gant"/>
<gant file="build/package.gant">
<definition name="buildDirectory" value="${project.build.directory}"/>
<definition name="executables" value="${executables}"/>
<definition name="productVersion" value="${project.version}"/>
</gant>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.onedev</groupId>
<artifactId>server-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.onedev</groupId>
<artifactId>server-plugin-artifact</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.onedev</groupId>
<artifactId>server-plugin-htmlreport</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<properties>
<executables>bin/*.sh, boot/wrapper-*</executables>
<bootstrapClass>io.onedev.commons.launcher.bootstrap.Bootstrap</bootstrapClass>
<moduleClass>io.onedev.server.product.ProductModule</moduleClass>
<aggregation>true</aggregation>
</properties>
</project>

View File

@ -7,14 +7,10 @@
<parent> <parent>
<groupId>io.onedev</groupId> <groupId>io.onedev</groupId>
<artifactId>server</artifactId> <artifactId>server</artifactId>
<version>2.1.4</version> <version>3.0.0</version>
</parent> </parent>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>io.onedev</groupId>
<artifactId>plugin-maven</artifactId>
</plugin>
<plugin> <plugin>
<groupId>org.antlr</groupId> <groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId> <artifactId>antlr4-maven-plugin</artifactId>

View File

@ -43,7 +43,7 @@ public class OneDev extends AbstractPlugin implements Serializable {
private static final Logger logger = LoggerFactory.getLogger(OneDev.class); private static final Logger logger = LoggerFactory.getLogger(OneDev.class);
private final JettyRunner jettyRunner; private final JettyRunner jettyRunner;
private final PersistManager persistManager; private final PersistManager persistManager;
private final SessionManager sessionManager; private final SessionManager sessionManager;
@ -51,7 +51,7 @@ public class OneDev extends AbstractPlugin implements Serializable {
private final SettingManager configManager; private final SettingManager configManager;
private final DataManager dataManager; private final DataManager dataManager;
private final UserManager userManager; private final UserManager userManager;
private final ServerConfig serverConfig; private final ServerConfig serverConfig;

Some files were not shown because too many files have changed in this diff Show More