Repository: yetus Updated Branches: refs/heads/master a54a4f5ae -> 6ebaa1119
http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-assemblies/pom.xml ---------------------------------------------------------------------- diff --git a/yetus-assemblies/pom.xml b/yetus-assemblies/pom.xml new file mode 100644 index 0000000..bfe9134 --- /dev/null +++ b/yetus-assemblies/pom.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<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> + <parent> + <groupId>org.apache.yetus</groupId> + <artifactId>yetus-project</artifactId> + <version>0.9.0-SNAPSHOT</version> + <relativePath>..</relativePath> + </parent> + <artifactId>yetus-assemblies</artifactId> + <description>Common Assemblies Creation</description> + <name>Apache Yetus - Assemblies</name> + <packaging>jar</packaging> + + <build> + <plugins> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + </plugins> + </build> + +</project> http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-assemblies/src/main/resources/assemblies/module-dist.xml ---------------------------------------------------------------------- diff --git a/yetus-assemblies/src/main/resources/assemblies/module-dist.xml b/yetus-assemblies/src/main/resources/assemblies/module-dist.xml new file mode 100644 index 0000000..9665964 --- /dev/null +++ b/yetus-assemblies/src/main/resources/assemblies/module-dist.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>module-dist</id> + <formats> + <format>tar.gz</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>${project.build.directory}/dist/apache-yetus-${project.version}</directory> + <outputDirectory>apache-yetus-${project.version}</outputDirectory> + <includes> + <include>**</include> + </includes> + <fileMode>0755</fileMode> + </fileSet> + </fileSets> +</assembly> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-assemblies/src/main/resources/assemblies/script-bundle.xml ---------------------------------------------------------------------- diff --git a/yetus-assemblies/src/main/resources/assemblies/script-bundle.xml b/yetus-assemblies/src/main/resources/assemblies/script-bundle.xml new file mode 100644 index 0000000..5a28d76 --- /dev/null +++ b/yetus-assemblies/src/main/resources/assemblies/script-bundle.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>script-bundle</id> + <formats> + <format>dir</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>${basedir}/src/main/shell</directory> + <outputDirectory>lib/${project.artifactId}</outputDirectory> + <includes> + <include>**</include> + </includes> + <fileMode>0755</fileMode> + </fileSet> + <fileSet> + <directory>${basedir}/src/main/python</directory> + <outputDirectory>lib/${project.artifactId}</outputDirectory> + <includes> + <include>**</include> + </includes> + <fileMode>0755</fileMode> + </fileSet> + </fileSets> +</assembly> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-dist/pom.xml ---------------------------------------------------------------------- diff --git a/yetus-dist/pom.xml b/yetus-dist/pom.xml new file mode 100644 index 0000000..680d3d2 --- /dev/null +++ b/yetus-dist/pom.xml @@ -0,0 +1,310 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<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> + <parent> + <groupId>org.apache.yetus</groupId> + <artifactId>yetus-project</artifactId> + <version>0.9.0-SNAPSHOT</version> + <relativePath>..</relativePath> + </parent> + <artifactId>yetus-dist</artifactId> + <description>Distrbution Creation</description> + <name>Apache Yetus - Distribution</name> + <packaging>pom</packaging> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.yetus</groupId> + <artifactId>asf-site</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.yetus</groupId> + <artifactId>audience-annotations-component</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.yetus</groupId> + <artifactId>precommit</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.yetus</groupId> + <artifactId>releasedocmaker</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.yetus</groupId> + <artifactId>shelldocs</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.yetus</groupId> + <artifactId>yetus-minimaven-plugin</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + </dependencyManagement> + + <build> + <plugins> + + <plugin> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>build</id> + <phase>generate-sources</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>releasedocmaker</artifactId> + <version>${project.version}</version> + <type>tar.gz</type> + <outputDirectory>${project.build.directory}</outputDirectory> + </artifactItem> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>precommit</artifactId> + <version>${project.version}</version> + <type>tar.gz</type> + <outputDirectory>${project.build.directory}</outputDirectory> + </artifactItem> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>shelldocs</artifactId> + <version>${project.version}</version> + <type>tar.gz</type> + <outputDirectory>${project.build.directory}</outputDirectory> + </artifactItem> + </artifactItems> + </configuration> + </execution> + + </executions> + </plugin> + + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <executions> + <execution> + <id>copy-resources</id> + <phase>prepare-package</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/apache-yetus-${project.version}/lib</outputDirectory> + <resources> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>VERSION</include> + </includes> + <filtering>true</filtering> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>pre-bin-dist</id> + <phase>prepare-package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <finalName>apache-yetus-${project.version}</finalName> + <appendAssemblyId>false</appendAssemblyId> + <attach>false</attach> + <descriptors> + <descriptor>src/main/assemblies/${project.artifactId}.xml</descriptor> + </descriptors> + </configuration> + </execution> + <!-- execution> + <id>src-dist</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <appendAssemblyId>false</appendAssemblyId> + <tarLongFileMode>gnu</tarLongFileMode> + <attach>false</attach> + <finalName>apache-yetus-${project.version}-src</finalName> + <outputDirectory>${project.build.directory}/artifacts</outputDirectory> + <descriptors> + <descriptor>src/main/assemblies/source.xml</descriptor> + </descriptors> + </configuration> + </execution --> + <execution> + <id>pre-site-dist</id> + <phase>pre-site</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <appendAssemblyId>false</appendAssemblyId> + <tarLongFileMode>gnu</tarLongFileMode> + <attach>false</attach> + <finalName>apache-yetus-${project.version}-site</finalName> + <outputDirectory>${project.build.directory}</outputDirectory> + <descriptors> + <descriptor>src/main/assemblies/site.xml</descriptor> + </descriptors> + </configuration> + </execution> + <execution> + <id>bin-dist</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <appendAssemblyId>false</appendAssemblyId> + <tarLongFileMode>gnu</tarLongFileMode> + <attach>false</attach> + <finalName>artifacts/apache-yetus-${project.version}-bin</finalName> + <descriptors> + <descriptor>src/main/assemblies/bin-tgz.xml</descriptor> + </descriptors> + </configuration> + </execution> + <execution> + <id>site-dist</id> + <phase>site</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <appendAssemblyId>false</appendAssemblyId> + <tarLongFileMode>gnu</tarLongFileMode> + <attach>false</attach> + <finalName>artifacts/apache-yetus-${project.version}-site</finalName> + <descriptors> + <descriptor>src/main/assemblies/site-tgz.xml</descriptor> + </descriptors> + </configuration> + </execution> + <execution> + <id>site-meta-dist</id> + <phase>site</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <appendAssemblyId>false</appendAssemblyId> + <tarLongFileMode>gnu</tarLongFileMode> + <attach>false</attach> + <finalName>artifacts</finalName> + <outputDirectory>${project.build.directory}</outputDirectory> + <descriptors> + <descriptor>src/main/assemblies/site-meta.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <configuration> + <useMavenDefaultExcludes>false</useMavenDefaultExcludes> + <excludeSubprojects>false</excludeSubprojects> + <excludes> + <exclude>src/main/resources/VERSION</exclude> + <exclude>target/apache-yetus-${project.version}/lib/VERSION</exclude> + <exclude>target/apache-yetus-${project.version}/lib/precommit/unit-test-filter-file.example</exclude> + </excludes> + <includes> + <include>target/apache-yetus-${project.version}/**</include> + <!-- + The docs are covered under asf-site for the time being. + <include>target/apache-yetus-${project.version}-site/**</include --> + + </includes> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + + </plugins> + + </build> + + <profiles> + <profile> + <id>apache-release</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <build> + <plugins> + <plugin> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>src-copy</id> + <phase>generate-sources</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>yetus-project</artifactId> + <classifier>source-release</classifier> + <version>${project.version}</version> + <type>tar.gz</type> + <outputDirectory>${project.build.directory}/artifacts</outputDirectory> + <destFileName>apache-yetus-${project.version}-src.tar.gz</destFileName> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-dist/src/main/assemblies/bin-tgz.xml ---------------------------------------------------------------------- diff --git a/yetus-dist/src/main/assemblies/bin-tgz.xml b/yetus-dist/src/main/assemblies/bin-tgz.xml new file mode 100644 index 0000000..180024d --- /dev/null +++ b/yetus-dist/src/main/assemblies/bin-tgz.xml @@ -0,0 +1,34 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>yetus-bin-tgz</id> + <formats> + <format>tar.gz</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>${project.build.directory}/apache-yetus-${project.version}</directory> + <outputDirectory>apache-yetus-${project.version}</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + </fileSets> +</assembly> http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-dist/src/main/assemblies/site-meta.xml ---------------------------------------------------------------------- diff --git a/yetus-dist/src/main/assemblies/site-meta.xml b/yetus-dist/src/main/assemblies/site-meta.xml new file mode 100644 index 0000000..b9c4963 --- /dev/null +++ b/yetus-dist/src/main/assemblies/site-meta.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>site-meta-pkg</id> + <formats> + <format>dir</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>../asf-site-src/source/documentation/in-progress/</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>CHANGELOG.md</include> + <include>RELEASENOTES.md</include> + </includes> + </fileSet> + </fileSets> +</assembly> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-dist/src/main/assemblies/site-tgz.xml ---------------------------------------------------------------------- diff --git a/yetus-dist/src/main/assemblies/site-tgz.xml b/yetus-dist/src/main/assemblies/site-tgz.xml new file mode 100644 index 0000000..97c0392 --- /dev/null +++ b/yetus-dist/src/main/assemblies/site-tgz.xml @@ -0,0 +1,34 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>yetus-site-tgz</id> + <formats> + <format>tar.gz</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>${project.build.directory}/apache-yetus-${project.version}-site</directory> + <outputDirectory>apache-yetus-${project.version}-site</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + </fileSets> +</assembly> http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-dist/src/main/assemblies/site.xml ---------------------------------------------------------------------- diff --git a/yetus-dist/src/main/assemblies/site.xml b/yetus-dist/src/main/assemblies/site.xml new file mode 100644 index 0000000..d1c2db6 --- /dev/null +++ b/yetus-dist/src/main/assemblies/site.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>site-pre-pkg</id> + <formats> + <format>dir</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>${project.build.directory}/../../audience-annotations-component/audience-annotations/target/site</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + <fileSet> + <directory>${project.build.directory}/../../precommit/target/site</directory> + <outputDirectory>documentation/in-progress/audience-annotations-apidocs</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + <fileSet> + <directory>${project.build.directory}/../../releasedocmaker/target/site</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + <fileSet> + <directory>${project.build.directory}/../../shelldocs/target/site</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + <fileSet> + <directory>${project.build.directory}/../../asf-site-src/target/site</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + <fileSet> + <directory>${project.build.directory}/../../asf-site-src/target/release/${project.version}</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + <fileSet> + <directory>${project.build.directory}/../..</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>LICENSE</include> + <include>NOTICE</include> + <include>README.md</include> + </includes> + </fileSet> + </fileSets> +</assembly> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-dist/src/main/assemblies/source.xml ---------------------------------------------------------------------- diff --git a/yetus-dist/src/main/assemblies/source.xml b/yetus-dist/src/main/assemblies/source.xml new file mode 100644 index 0000000..eb6eb39 --- /dev/null +++ b/yetus-dist/src/main/assemblies/source.xml @@ -0,0 +1,43 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>yetus-src</id> + <formats> + <format>tar.gz</format> + </formats> + <includeBaseDirectory>true</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>..</directory> + <useDefaultExcludes>true</useDefaultExcludes> + <excludes> + <exclude>.git/**</exclude> + <exclude>**/.gitignore</exclude> + <exclude>**/.svn</exclude> + <exclude>**/*.iws</exclude> + <exclude>**/*.ipr</exclude> + <exclude>**/*.iml</exclude> + <exclude>**/.classpath</exclude> + <exclude>**/.project</exclude> + <exclude>**/.settings</exclude> + <exclude>**/target/**</exclude> + </excludes> + </fileSet> + </fileSets> +</assembly> http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-dist/src/main/assemblies/yetus-dist.xml ---------------------------------------------------------------------- diff --git a/yetus-dist/src/main/assemblies/yetus-dist.xml b/yetus-dist/src/main/assemblies/yetus-dist.xml new file mode 100644 index 0000000..251b14e --- /dev/null +++ b/yetus-dist/src/main/assemblies/yetus-dist.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>precommit</id> + <formats> + <format>dir</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>${project.build.directory}/../../audience-annotations-component/audience-annotations/target/apache-yetus-${project.version}</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + <fileSet> + <directory>${project.build.directory}/../../audience-annotations-component/audience-annotations-jdiff/target/apache-yetus-${project.version}</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + <fileSet> + <directory>${project.build.directory}/../../asf-site-src/target/release/${project.version}</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + <fileSet> + <directory>${project.build.directory}/../..</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>LICENSE</include> + <include>NOTICE</include> + <include>README.md</include> + </includes> + </fileSet> + </fileSets> +</assembly> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-dist/src/main/resources/VERSION ---------------------------------------------------------------------- diff --git a/yetus-dist/src/main/resources/VERSION b/yetus-dist/src/main/resources/VERSION new file mode 100644 index 0000000..f2ab45c --- /dev/null +++ b/yetus-dist/src/main/resources/VERSION @@ -0,0 +1 @@ +${project.version} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-maven-plugin/pom.xml ---------------------------------------------------------------------- diff --git a/yetus-maven-plugin/pom.xml b/yetus-maven-plugin/pom.xml new file mode 100644 index 0000000..13072d4 --- /dev/null +++ b/yetus-maven-plugin/pom.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<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> + <parent> + <groupId>org.apache.yetus</groupId> + <artifactId>yetus-project</artifactId> + <version>0.9.0-SNAPSHOT</version> + <relativePath>..</relativePath> + </parent> + <artifactId>yetus-maven-plugin</artifactId> + <description>Apache Yetus Maven Tools</description> + <name>Apache Yetus - Maven Plugin</name> + <packaging>maven-plugin</packaging> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>${maven.plugin.api.version}</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>${commons.io.version}</version> + </dependency> + <dependency> + <groupId>org.apache.yetus</groupId> + <artifactId>audience-annotations</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.plugin-tools</groupId> + <artifactId>maven-plugin-annotations</artifactId> + <version>${maven.api.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.yetus</groupId> + <artifactId>releasedocmaker</artifactId> + <version>${project.version}</version> + <classifier>jar-with-dependencies</classifier> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>${build-helper-maven-plugin.version}</version> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>../yetus-minimaven-plugin/src/main</source> + </sources> + </configuration> + </execution> + <execution> + <id>add-resource</id> + <phase>generate-resources</phase> + <goals> + <goal>add-resource</goal> + </goals> + <configuration> + <resources> + <resource> + <directory>../yetus-minimaven-plugin/src/main/resources</directory> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>create-internal-zip</id> + <phase>prepare-package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <finalName>classes/yetus-bin</finalName> + <appendAssemblyId>false</appendAssemblyId> + <attach>false</attach> + <descriptors> + <descriptor>src/main/assemblies/yetus-maven-plugin.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <executions> + <execution> + <id>default-descriptor</id> + <phase>compile</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-maven-plugin/src/main/assemblies/yetus-maven-plugin.xml ---------------------------------------------------------------------- diff --git a/yetus-maven-plugin/src/main/assemblies/yetus-maven-plugin.xml b/yetus-maven-plugin/src/main/assemblies/yetus-maven-plugin.xml new file mode 100644 index 0000000..4e8c748 --- /dev/null +++ b/yetus-maven-plugin/src/main/assemblies/yetus-maven-plugin.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>yetus-maven-plugin</id> + <formats> + <format>zip</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>${project.build.directory}/../../releasedocmaker/target/dist/apache-yetus-${project.version}</directory> + <outputDirectory>.</outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + </fileSets> +</assembly> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/CreateDirsMojo.java ---------------------------------------------------------------------- diff --git a/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/CreateDirsMojo.java b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/CreateDirsMojo.java new file mode 100644 index 0000000..8c61cd4 --- /dev/null +++ b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/CreateDirsMojo.java @@ -0,0 +1,97 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.yetus.maven.plugin.fileops; + +import java.io.File; + +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; + +/** + * Goal which creates the X directories. + */ +@Mojo(name = "parallel-mkdirs", + defaultPhase = LifecyclePhase.GENERATE_TEST_RESOURCES, + threadSafe = true) +public final class CreateDirsMojo extends AbstractMojo { + + /** + * Location of the dirName. + */ + @Parameter(defaultValue = "${project.build.directory}/test-dir") + private File buildDir; + + /** + * Thread count. + */ + @Parameter(defaultValue = "1") + private String forkCount; + + /** + * Execute our plugin. + * @throws MojoExecutionException an error occurred + */ + public void execute() throws MojoExecutionException { + int numDirs = getForkCount(); + + mkParallelDirs(buildDir, numDirs); + } + + /** + * Get the real number of parallel threads. + * @return int number of threads + */ + public int getForkCount() { + int calcForkCount = 1; + if (forkCount != null) { + String trimProp = forkCount.trim(); + if (trimProp.endsWith("C")) { + double multiplier = Double.parseDouble( + trimProp.substring(0, trimProp.length() - 1)); + double calculated = multiplier * ((double) Runtime + .getRuntime() + .availableProcessors()); + if (calculated > 0d) { + calcForkCount = Math.max((int) calculated, 1); + } + } else { + calcForkCount = Integer.parseInt(forkCount); + } + } + return calcForkCount; + } + + /** + * Make the directories. + * @param pDir base directory + * @param numDirs number of directories to create + * @throws MojoExecutionException an error occurred + */ + private void mkParallelDirs(final File pDir, final int numDirs) + throws MojoExecutionException { + for (int i = 1; i <= numDirs; i++) { + File newDir = new File(pDir, String.valueOf(i)); + if (!newDir.exists()) { + getLog().info("Creating " + newDir.toString()); + if (!newDir.mkdirs()) { + throw new MojoExecutionException("Unable to create " + + newDir.toString()); + } + } + } + } +} http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/package-info.java ---------------------------------------------------------------------- diff --git a/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/package-info.java b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/package-info.java new file mode 100644 index 0000000..1a91cef --- /dev/null +++ b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Utilities for various file operations. + */ +package org.apache.yetus.maven.plugin.fileops; http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/rdm/ReleaseDocMakerMojo.java ---------------------------------------------------------------------- diff --git a/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/rdm/ReleaseDocMakerMojo.java b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/rdm/ReleaseDocMakerMojo.java new file mode 100644 index 0000000..8736ddd --- /dev/null +++ b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/rdm/ReleaseDocMakerMojo.java @@ -0,0 +1,234 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.yetus.maven.plugin.rdm; + +import java.io.File; +import java.util.ArrayList; +import org.apache.yetus.maven.plugin.utils.Utils; + +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.yetus.releasedocmaker.ReleaseDocMaker; + +/** + * Goal which executes releasedocmaker. + */ +@Mojo(name = "releasedocmaker", + defaultPhase = LifecyclePhase.PRE_SITE, + threadSafe = true) +public final class ReleaseDocMakerMojo extends AbstractMojo { + + /** + * Location of output. + */ + @Parameter + private String baseUrl; + + /** + * Location of the dirName. + */ + @Parameter(defaultValue = "${project.build.directory}") + private File buildDir; + + /** + * Create diretory versions. + */ + @Parameter(defaultValue = "false") + private Boolean dirversions; + + /** + * Create file versions. + */ + @Parameter(defaultValue = "false") + private Boolean fileversions; + + /** + * label for incompatible issues + */ + @Parameter + private String incompatibleLabel; + + /** + * Create an index. + */ + @Parameter(defaultValue = "false") + private Boolean index; + + /** + * Put the ASF License on generated files. + */ + @Parameter(defaultValue = "false") + private Boolean license; + + /** + * Run in --lint mode. + */ + @Parameter(defaultValue = "false") + private Boolean lint; + + /** + * Location of output. + */ + @Parameter(defaultValue = "${project.build.directory}/generated-site/markdown") + private String outputDir; + + /** + * Put the ASF License on generated files. + */ + @Parameter(defaultValue = "${project.name}") + private String[] projects; + + /** + * Title of project. + */ + @Parameter + private String projectTitle; + + /** + * Treat versions as a range. + */ + @Parameter(defaultValue = "false") + private Boolean range; + + /** + * Drop reporter/assignee + */ + @Parameter(defaultValue = "false") + private Boolean skipcredits; + + /** + * Set the sort order + */ + @Parameter(defaultValue = "older") + private String sortorder; + + /** + * Set the type order + */ + @Parameter(defaultValue = "resolutiondate") + private String sorttype; + + /** + * Use today. + */ + @Parameter(defaultValue = "false") + private Boolean useToday; + + /** + * Version to generate. + */ + @Parameter(defaultValue = "${project.version}") + private String[] versions; + + /** + * Build our argument list to pass to the executor. + */ + private ArrayList<String> argList = new ArrayList<String>(); + + /** + * Execute our plugin. + * @throws MojoExecutionException an error occurred + */ + public void execute() throws MojoExecutionException { + + buildArgs(); + String [] args = argList.toArray(new String[0]); + + ReleaseDocMaker rdm=new ReleaseDocMaker(); + ReleaseDocMaker.main(args); + } + + + /** + * Based upon what we got from maven, build our rdm command line params. + */ + private void buildArgs() { + + if (baseUrl != null ) { + argList.add("--baseurl"); + argList.add(baseUrl); + } + + if (dirversions) { + argList.add("--dirversions"); + } + + if (fileversions) { + argList.add("--fileversions"); + } + + if (incompatibleLabel != null) { + argList.add("--incompatiblelabel"); + argList.add(incompatibleLabel); + } + + if (index) { + argList.add("--index"); + } + + if (license) { + argList.add("--license"); + } + + if (lint) { + argList.add("--lint"); + } + + argList.add("--outputdir"); + argList.add(outputDir); + + for (String p: projects) { + argList.add("--project"); + argList.add(p); + } + + if (projectTitle != null) { + argList.add("--projecttitle"); + argList.add(projectTitle); + } + + if (range) { + argList.add("--range"); + } + + if (skipcredits) { + argList.add("--skipcredits"); + } + + if (sortorder != null) { + argList.add("--sortorder"); + argList.add(sortorder); + } + + if (sorttype != null) { + argList.add("--sorttype"); + argList.add(sorttype); + } + + if (useToday) { + argList.add("--usetoday"); + } + + for (String v: versions) { + argList.add("--version"); + argList.add(v); + } + + } + +} http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/rdm/package-info.java ---------------------------------------------------------------------- diff --git a/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/rdm/package-info.java b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/rdm/package-info.java new file mode 100644 index 0000000..04067bd --- /dev/null +++ b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/rdm/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Utilities for running releasedocmaker. + */ +package org.apache.yetus.maven.plugin.rdm; http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/utils/Utils.java ---------------------------------------------------------------------- diff --git a/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/utils/Utils.java b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/utils/Utils.java new file mode 100644 index 0000000..e8616f9 --- /dev/null +++ b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/utils/Utils.java @@ -0,0 +1,131 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.yetus.maven.plugin.utils; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.util.Arrays; +import java.util.List; +import java.util.LinkedList; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + + +import org.apache.yetus.audience.InterfaceAudience; +import org.apache.yetus.audience.InterfaceStability; + + +/** + * Random utilities for running Yetus components. + */ [email protected] [email protected] +public final class Utils { + + /** + * Buffer size used while zipping and unzipping zip-ed archives. + */ + private static final int BUFFER_SIZE = 8192; + + + /** + * InputStream from the classpath that has our archive. + */ + private ZipInputStream zipFile; + + /** + * extracted dir+bin. + */ + private File binDir; + + + /** + * Constructor for generic utilities. + */ + public Utils() { + this.zipFile = new ZipInputStream(this.getClass() + .getClassLoader() + .getResourceAsStream("yetus-bin.zip")); + } + + /** + * Execute the yetus command with the given parameters. + * @param cmd command to execute + * @param args to that command + * @throws IOException an error occurred + * @throws InterruptedException an error occurred + * @return int process return code + */ + public int execCmd(final String cmd, final String... args) + throws IOException, InterruptedException { + File cmdFile = new File(binDir, cmd); + String realCmd = cmdFile.toString(); + + String[] params = args; + + List<String> list = new LinkedList<String>(Arrays.asList(args)); + list.add(0, realCmd); + params = list.toArray(new String[list.size()]); + + ProcessBuilder pb = new ProcessBuilder(params); + pb.inheritIO(); + Process p = pb.start(); + return p.waitFor(); + } + + /** + * Extract the yetus-bin file in the dest directory. + * @param destDir The unzip directory where to extractthe file. + * @throws IOException an error occurred + */ + public void extractYetus(final File destDir) throws IOException { + this.binDir = new File(destDir, "bin"); + + if (binDir.isDirectory()) { + return; + } + try { + ZipEntry entry; + while ((entry = zipFile.getNextEntry()) != null) { + if (!entry.isDirectory()) { + File file = new File(destDir, entry.getName()); + if (!file.getParentFile().mkdirs()) { + if (!file.getParentFile().isDirectory()) { + throw new IOException("Mkdirs failed to create " + + file.getParentFile().toString()); + } + } + OutputStream out = new FileOutputStream(file); + try { + byte[] buffer = new byte[BUFFER_SIZE]; + int i; + while ((i = zipFile.read(buffer)) != -1) { + out.write(buffer, 0, i); + } + } finally { + out.close(); + } + file.setExecutable(true); + file.setReadable(true); + file.setWritable(true); + } + } + } finally { + zipFile.close(); + } + } + +} http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/utils/package-info.java ---------------------------------------------------------------------- diff --git a/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/utils/package-info.java b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/utils/package-info.java new file mode 100644 index 0000000..8e04ace --- /dev/null +++ b/yetus-maven-plugin/src/main/java/org/apache/yetus/maven/plugin/utils/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Utilities for running Yetus. + */ +package org.apache.yetus.maven.plugin.utils; http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-minimaven-plugin/pom.xml ---------------------------------------------------------------------- diff --git a/yetus-minimaven-plugin/pom.xml b/yetus-minimaven-plugin/pom.xml new file mode 100644 index 0000000..49dd4e5 --- /dev/null +++ b/yetus-minimaven-plugin/pom.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<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> + <parent> + <groupId>org.apache.yetus</groupId> + <artifactId>yetus-project</artifactId> + <version>0.9.0-SNAPSHOT</version> + <relativePath>..</relativePath> + </parent> + <groupId>org.apache.yetus</groupId> + <artifactId>yetus-minimaven-plugin</artifactId> + <description>Apache Yetus Maven Build Tools</description> + <name>Apache Yetus - MiniMaven Plugin</name> + <packaging>maven-plugin</packaging> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>${maven.plugin.api.version}</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>${commons.io.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.plugin-tools</groupId> + <artifactId>maven-plugin-annotations</artifactId> + <version>${maven.api.version}</version> + <scope>provided</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <version>${maven.api.version}</version> + <executions> + <execution> + <id>default-descriptor</id> + <phase>compile</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + + </plugins> + </build> + +</project> http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/CreateSymLinkMojo.java ---------------------------------------------------------------------- diff --git a/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/CreateSymLinkMojo.java b/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/CreateSymLinkMojo.java new file mode 100644 index 0000000..c93a9ed --- /dev/null +++ b/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/CreateSymLinkMojo.java @@ -0,0 +1,94 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.yetus.maven.plugin.fileops; + +import java.nio.file.Files; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.Path; +import java.nio.file.Paths; + +//import org.apache.maven.execution.MavenSession; + +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; + +/** + * Goal which creates symlinks. + */ +@Mojo(name = "symlink", + defaultPhase = LifecyclePhase.PACKAGE, + threadSafe = true) +public final class CreateSymLinkMojo extends AbstractMojo { + + /** + * Location of the target. + */ + @Parameter + private String target; + + /** + * the link to create. + */ + @Parameter + private String newLink; + + /** + * ignore already exists errors. + */ + @Parameter(defaultValue = "true") + private Boolean ignoreExist; + + + /** + * starting directory for relatives. + */ + @Parameter(defaultValue = "${project.build.directory}") + private String basedir; + + /** + * starting directory for relatives. + * @throws MojoExecutionException an error occurred + */ + public void execute() throws MojoExecutionException { + if (target == null) { + throw new MojoExecutionException("target of symlink is undefined."); + } + + if (newLink == null) { + throw new MojoExecutionException("newLink of symlink is undefined."); + } + + Path targetPath = Paths.get(target); + Path newLinkPath = Paths.get(newLink); + + if (!newLinkPath.isAbsolute()) { + newLinkPath = Paths.get(basedir, newLink); + } + + try { + Files.createSymbolicLink(newLinkPath, targetPath); + } catch (FileAlreadyExistsException x) { + if (!ignoreExist) { + throw new MojoExecutionException("Unable to create " + + newLinkPath.toString() + ": " + targetPath.toString() + " " + x); + } + } catch (Exception x) { + throw new MojoExecutionException("Unable to create " + + newLinkPath.toString() + ": " + targetPath.toString() + " " + x); + } + } +} http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/MakeBins4Libs.java ---------------------------------------------------------------------- diff --git a/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/MakeBins4Libs.java b/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/MakeBins4Libs.java new file mode 100644 index 0000000..cb6b2cc --- /dev/null +++ b/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/MakeBins4Libs.java @@ -0,0 +1,156 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.yetus.maven.plugin.fileops; + +import java.io.File; +import java.io.PrintWriter; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.PosixFilePermission; +import java.util.HashSet; +import java.util.Set; + +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.commons.io.FilenameUtils; +import org.apache.commons.io.IOUtils; + + +/** + * Goal which creates symlinks. + */ +@Mojo(name = "bin4libs", + defaultPhase = LifecyclePhase.PACKAGE, + threadSafe = true) +public final class MakeBins4Libs extends AbstractMojo { + + /** + * bin dir. + */ + @Parameter(defaultValue = "bin") + private String bindir; + + /** + * lib dir. + */ + @Parameter(defaultValue = "lib") + private String libdir; + + /** + * License to use as a header. + */ + @Parameter(defaultValue = "ASL20") + private String license; + + /** + * parent of bin and lib dir, if relative. + */ + @Parameter(defaultValue = + "${project.build.directory}/${project.artifactId}-${project.version}") + private String basedir; + + /** + * wrapper to put down. + */ + private String wrapper = "exec \"$(dirname -- \"${BASH_SOURCE-0}\")/../"; + + /** + * The file encoding to use when reading/writing the source files. + */ + @Parameter (property = "encoding", + defaultValue = "${project.build.sourceEncoding}") + private String encoding; + + /** + * Execute our plugin. + * @throws MojoExecutionException an error occurred + */ + public void execute() throws MojoExecutionException { + + Path libPath = Paths.get(libdir); + Path binPath = Paths.get(bindir); + + if (!libPath.isAbsolute()) { + libPath = Paths.get(basedir, libdir); + } + + if (!binPath.isAbsolute()) { + binPath = Paths.get(basedir, bindir); + } + + try { + binPath.toFile().mkdir(); + } catch (Exception x) { + throw new MojoExecutionException("Unable to create " + + binPath.toString() + ": " + x); + } + + Set<PosixFilePermission> perms = new HashSet<PosixFilePermission>(); + perms.add(PosixFilePermission.OWNER_READ); + perms.add(PosixFilePermission.OWNER_WRITE); + perms.add(PosixFilePermission.OWNER_EXECUTE); + perms.add(PosixFilePermission.GROUP_READ); + perms.add(PosixFilePermission.GROUP_EXECUTE); + perms.add(PosixFilePermission.OTHERS_READ); + perms.add(PosixFilePermission.OTHERS_EXECUTE); + + File libFile = libPath.toFile(); + if (libFile == null) { + throw new MojoExecutionException("Cannot convert " + + libPath.toString()); + } + + File[] libListOfFiles = libFile.listFiles(); + System.out.println("Processing dir " + libPath.toString()); + + for (int i = 0; i < libListOfFiles.length; i++) { + if (libListOfFiles[i].isFile()) { + String basename = FilenameUtils + .getBaseName(libListOfFiles[i].getName()); + String theName = FilenameUtils.getName(libListOfFiles[i].getName()); + String binName = Paths.get(binPath.toString(), basename).toString(); + System.out.println("Creating file " + binName); + + try { + PrintWriter binFile = new PrintWriter(binName, encoding); + String noneString = "none"; + + binFile.println("#!/usr/bin/env bash"); + + if (!license.equals(noneString)) { + InputStream inLicense = this.getClass() + .getClassLoader() + .getResourceAsStream("licenses/" + + license + ".txt"); + IOUtils.copy(inLicense, binFile); + inLicense.close(); + } + binFile.println(wrapper + libdir + "/" + theName + "\" \"$@\""); + binFile.close(); + Files.setPosixFilePermissions(Paths.get(binName), perms); + } catch (Exception x) { + throw new MojoExecutionException("Unable to create " + + binName + ": " + x); + + } + } + } + } +} http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/package-info.java ---------------------------------------------------------------------- diff --git a/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/package-info.java b/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/package-info.java new file mode 100644 index 0000000..b473904 --- /dev/null +++ b/yetus-minimaven-plugin/src/main/java/org/apache/yetus/maven/plugin/fileops/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Mini-maven just has the bits necessary to build Apache Yetus. + */ +package org.apache.yetus.maven.plugin.fileops; http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-minimaven-plugin/src/main/resources/licenses/ASL20.txt ---------------------------------------------------------------------- diff --git a/yetus-minimaven-plugin/src/main/resources/licenses/ASL20.txt b/yetus-minimaven-plugin/src/main/resources/licenses/ASL20.txt new file mode 100644 index 0000000..ae1e83e --- /dev/null +++ b/yetus-minimaven-plugin/src/main/resources/licenses/ASL20.txt @@ -0,0 +1,14 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. http://git-wip-us.apache.org/repos/asf/yetus/blob/6ebaa111/yetus-project/pom.xml ---------------------------------------------------------------------- diff --git a/yetus-project/pom.xml b/yetus-project/pom.xml deleted file mode 100644 index 2db8851..0000000 --- a/yetus-project/pom.xml +++ /dev/null @@ -1,171 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<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> - <parent> - <groupId>org.apache</groupId> - <artifactId>apache</artifactId> - <version>17</version> - <relativePath/> - <!-- no parent resolution --> - </parent> - <groupId>org.apache.yetus</groupId> - <artifactId>yetus-project</artifactId> - <version>0.9.0-SNAPSHOT</version> - <description>Project-wide definitions for Apache Yetus</description> - <name>Apache Yetus Project</name> - <packaging>pom</packaging> - - <url>https://yetus.apache.org</url> - <inceptionYear>2015</inceptionYear> - <mailingLists> - <mailingList> - <name>Apache Yetus Dev List</name> - <subscribe>[email protected]</subscribe> - <unsubscribe>[email protected]</unsubscribe> - <post>[email protected]</post> - <archive>https://mail-archives.apache.org/mod_mbox/yetus-dev/</archive> - </mailingList> - </mailingLists> - - <properties> - <maven.min.version>3.2.0</maven.min.version> - <java.min.version>1.7</java.min.version> - <maven.compiler.source>1.7</maven.compiler.source> - <maven.compiler.target>1.7</maven.compiler.target> - <extra.enforcer.version>1.0-beta-3</extra.enforcer.version> - </properties> - - <scm> - <connection>scm:git:git://git.apache.org/yetus.git</connection> - <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/yetus.git</developerConnection> - <url>https://git-wip-us.apache.org/repos/asf?p=yetus.git</url> - </scm> - <issueManagement> - <system>JIRA</system> - <url>http://issues.apache.org/jira/browse/YETUS</url> - </issueManagement> - - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.codehaus.mojo</groupId> - <artifactId>extra-enforcer-rules</artifactId> - <version>${extra.enforcer.version}</version> - </dependency> - <dependency> - <groupId>jdk.tools</groupId> - <artifactId>jdk.tools</artifactId> - <version>1.7</version> - <scope>system</scope> - <systemPath>${java.home}/../lib/tools.jar</systemPath> - </dependency> - </dependencies> - </dependencyManagement> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <dependencies> - <dependency> - <groupId>org.codehaus.mojo</groupId> - <artifactId>extra-enforcer-rules</artifactId> - <version>${extra.enforcer.version}</version> - </dependency> - </dependencies> - <!-- version set by parent --> - <executions> - <execution> - <id>enforce</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <!-- The earliest maven version we verify builds for via ASF Jenkins --> - <!-- Might be obviated by move to gradle --> - <requireMavenVersion> - <version>[${maven.min.version},)</version> - <message>Maven is out of date. - Yetus requires at least version ${maven.min.version} of Maven to properly build from source. - You appear to be using an older version. You can use either "mvn -version" or - "mvn enforcer:display-info" to verify what version is active. - See the contributor guide on building for more information: ${project.url}/contribute/ - </message> - </requireMavenVersion> - <!-- The earliest JVM version we verify builds for via ASF Jenkins --> - <requireJavaVersion> - <version>[${java.min.version},)</version> - <message>Java is out of date. - Yetus requires at least version ${java.min.version} of the JDK to properly build from source. - You appear to be using an older version. You can use either "mvn -version" or - "mvn enforcer:display-info" to verify what version is active. - See the contributor guide on building for more information: ${project.url}/contribute/ - </message> - </requireJavaVersion> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - <profiles> - <profile> - <id>jdk1.7</id> - <activation> - <jdk>1.7</jdk> - </activation> - <dependencyManagement> - <dependencies> - <dependency> - <groupId>jdk.tools</groupId> - <artifactId>jdk.tools</artifactId> - <version>1.7</version> - <scope>system</scope> - <systemPath>${java.home}/../lib/tools.jar</systemPath> - </dependency> - </dependencies> - </dependencyManagement> - </profile> - <profile> - <id>jdk1.8</id> - <activation> - <jdk>1.8</jdk> - </activation> - <dependencyManagement> - <dependencies> - <dependency> - <groupId>jdk.tools</groupId> - <artifactId>jdk.tools</artifactId> - <version>1.8</version> - <scope>system</scope> - <systemPath>${java.home}/../lib/tools.jar</systemPath> - </dependency> - </dependencies> - </dependencyManagement> - </profile> - </profiles> - -</project>
