Skip to content

Commit 80145a5

Browse files
committed
initial commit
0 parents  commit 80145a5

File tree

10 files changed

+743
-0
lines changed

10 files changed

+743
-0
lines changed

.github/workflows/maven.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ master, dev ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: 'temurin'
20+
java-version: '11'
21+
- uses: actions/cache@v1
22+
with:
23+
path: ~/.m2/repository
24+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
25+
restore-keys: ${{ runner.os }}-maven-
26+
- name: Build with Maven
27+
run: mvn -B clean verify

.gitignore

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
########## JAVA ###########
2+
3+
*.class
4+
5+
# Mobile Tools for Java (J2ME)
6+
.mtj.tmp/
7+
8+
# Package Files #
9+
*.jar
10+
*.war
11+
*.ear
12+
13+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
14+
hs_err_pid*
15+
target/
16+
17+
####### END OF JAVA #########
18+
19+
#IDEA
20+
.idea
21+
*.iml
22+
23+
##### ECLIPSE ####
24+
.metadata
25+
bin/
26+
tmp/
27+
*.tmp
28+
*.bak
29+
*.swp
30+
*~.nib
31+
local.properties
32+
.settings/
33+
.loadpath
34+
.recommenders
35+
36+
# Eclipse Core
37+
.project
38+
39+
# External tool builders
40+
.externalToolBuilders/
41+
42+
# Locally stored "Eclipse launch configurations"
43+
*.launch
44+
45+
# PyDev specific (Python IDE for Eclipse)
46+
*.pydevproject
47+
48+
# CDT-specific (C/C++ Development Tooling)
49+
.cproject
50+
51+
# JDT-specific (Eclipse Java Development Tools)
52+
.classpath
53+
54+
# Java annotation processor (APT)
55+
.factorypath
56+
57+
# PDT-specific (PHP Development Tools)
58+
.buildpath
59+
60+
# sbteclipse plugin
61+
.target
62+
63+
# Tern plugin
64+
.tern-project
65+
66+
# TeXlipse plugin
67+
.texlipse
68+
69+
# STS (Spring Tool Suite)
70+
.springBeans
71+
72+
# Code Recommenders
73+
.recommenders/
74+
75+
## END OF ECLIPSE ##
76+
77+
78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
88+
89+
90+
91+
92+
93+
94+
95+
96+
97+
## GRADLE ##
98+
99+
.gradle
100+
build/
101+
102+
# Ignore Gradle GUI config
103+
gradle-app.setting
104+
105+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
106+
!gradle-wrapper.jar
107+
108+
# Cache of project
109+
.gradletasknamecache
110+
111+
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
112+
# gradle/wrapper/gradle-wrapper.properties
113+
114+
## END OF GRADLE ##
115+
116+
.vscode

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 The department of the Algorithms and programming technologies of the Moscow Institute of Physics and Technology.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Export Maven Plugin
2+
3+
[![Actions Status: build](https://github.com/atp-mipt/export-maven-plugin/workflows/build/badge.svg)](https://github.com/atp-mipt/homework-quickstart/actions?query=workflow%3A"build")
4+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.atp-fivt/homework-quickstart/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.atp-fivt/export-maven-plugin)
5+
6+
The Export Maven Plugin is an Apache Maven plugin designed for exporting an entire Maven project into a .zip file. It respects the .gitignore settings and omits the build directory (target).
7+
8+
## Why is it needed?
9+
10+
Typically, archiving a project involves the following command:
11+
12+
```shell
13+
git archive -o export.zip HEAD
14+
```
15+
16+
However, in teaching environments, particularly when instructing large groups in Java, it's not always feasible to assume that Git is installed on all systems. In scenarios where Git is not part of the course curriculum, and lab/homework submissions are required in .zip format, it's important to ensure that students' submissions do not include unwanted files, such as those in the build folder or IDE-specific directories.
17+
18+
Since students are expected to use Maven and create their projects via [homework-quickstart archetype](https://github.com/atp-mipt/homework-quickstart), this simple plugin enables students to automatically export their projects in the required format without including unwanted files.
19+
20+
## How to use
21+
22+
To use the plugin, insert the following configuration into the plugins section of your pom.xml:
23+
24+
```xml
25+
<plugin>
26+
<groupId>org.atp-fivt</groupId>
27+
<artifactId>export-maven-plugin</artifactId>
28+
<version>1.0</version>
29+
<configuration>
30+
<zipFileName>Name_Surname.zip</zipFileName>
31+
</configuration>
32+
</plugin>
33+
```
34+
35+
The `zipFileName` parameter allows you to specify the desired name for the zip file. By default, the file name is set to export.zip.
36+
37+
To run the plugin, execute:
38+
39+
```shell
40+
mvn export:export
41+
```
42+
43+
The resulting `.zip` file will be located in the target directory.
44+
45+
## How does it work
46+
47+
This plugin leverages the [jGit](https://www.eclipse.org/jgit/) library to compile a list of all files in the project, adhering to the rules specified in `.gitignore` files. Importantly, the functionality of this plugin does not require Git to be installed on the target machine. This is particularly beneficial in educational settings or environments where Git installation cannot be assumed. By using jGit, the plugin operates independently of the local Git installation.

checkstyle-suppressions.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE suppressions PUBLIC
3+
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
4+
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
5+
6+
<suppressions>
7+
<suppress files="[/\\]target[/\\]" checks=".*" />
8+
</suppressions>

0 commit comments

Comments
 (0)