Skip to content

Commit 202d1dc

Browse files
author
biagio
committed
5.0.0
1 parent 124a8a1 commit 202d1dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+4834
-3172
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+
10+
# Binary files should be left untouched
11+
*.jar binary
12+

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- '**'
10+
release:
11+
types: [created]
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: '17'
24+
distribution: 'temurin'
25+
server-id: ossrh
26+
server-username: MAVEN_USERNAME
27+
server-password: MAVEN_PASSWORD
28+
29+
- name: Cache Gradle packages
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.gradle/caches
33+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
34+
restore-keys: ${{ runner.os }}-gradle
35+
36+
- name: Build with Gradle
37+
run: ./gradlew build -x test
38+
39+
- name: Run tests
40+
run: ./gradlew test
41+
42+
publish:
43+
needs: build
44+
if: github.event_name == 'release'
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
50+
- name: Set up JDK 17
51+
uses: actions/setup-java@v4
52+
with:
53+
java-version: '17'
54+
distribution: 'temurin'
55+
server-id: ossrh
56+
server-username: SONATYPE_USER
57+
server-password: SONATYPE_TOKEN
58+
59+
- name: Import GPG key
60+
run: |
61+
cat <(echo -e "${{ secrets.GPG_SIGNING_KEY }}") | gpg --batch --import
62+
env:
63+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
64+
65+
- name: Publish to Maven Central
66+
run: ./gradlew -Psigning.gnupg.passphrase=${{ secrets.GPG_SIGNING_PASSWORD }} -Psigning.gnupg.keyName=${{ secrets.GPG_SIGNING_KEY_ID }} publish closeAndReleaseStagingRepositories
67+
env:
68+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
69+
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}

.github/workflows/codeql.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '0 0 * * 1'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze Codebase
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 360
16+
permissions:
17+
security-events: write
18+
packages: read
19+
actions: read
20+
contents: read
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
include:
26+
- language: java-kotlin
27+
build-mode: none
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Initialize CodeQL
33+
uses: github/codeql-action/init@v3
34+
with:
35+
languages: ${{ matrix.language }}
36+
build-mode: ${{ matrix.build-mode }}
37+
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v3
40+
with:
41+
category: "/language:${{matrix.language}}"

.gitignore

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/target/
2-
/.project
3-
/.classpath
4-
/org.eclipse.*
5-
/.settings
6-
/bin
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
76
/.idea/

README.MD

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# PEC/Mail Parser
2+
Libreria utility per l'elaborazione di messaggi di [Posta Elettronica Certificata](https://www.agid.gov.it/it/piattaforme/posta-elettronica-certificata) (PEC) e messaggi di posta ordinaria.
3+
4+
### Dipendenza progetto
5+
Attenzione: le versioni precedenti alla 5.0.0 sono state rilasciato con groupId `app.tozzi.mail`
6+
7+
##### Maven
8+
```
9+
<dependency>
10+
<groupId>app.tozzi</groupId>
11+
<artifactId>pec-parser</artifactId>
12+
<version>5.0.0</version>
13+
</dependency>
14+
```
15+
16+
##### Gradle
17+
```
18+
implementation 'app.tozzi:pec-parser:5.0.0
19+
```
20+
21+
### Requisiti
22+
23+
| PEC Parser | Java |
24+
|-------------------|-----------|
25+
| [v0.0.1 - v4.0.0] | [8 - 22] |
26+
| [v5.0.0 - latest] | [17 - 22] |
27+
28+
### Utilizzo
29+
#### 1. Istanza di `MailParser`
30+
Attraverso uno dei seguenti metodi:
31+
- [ ] `MailParser.getInstance()`
32+
- [ ] `MailParser.getInstance(Properties properties)`
33+
- [ ] `MailParser.getInstance(Properties properties, boolean extractAllHeaders)`
34+
35+
#### 2. Parsing
36+
Attraverso uno dei seguenti metodi:
37+
- [ ] `ParsedEntity parse(MimeMessage mimeMessage)`
38+
- [ ] `ParsedEntity parse(File eml)`
39+
- [ ] `ParsedEntity parse(InputStream inputStream)`
40+
- [ ] `ParsedEntity parse(MimeMessage mimeMessage)`
41+
42+
#### 3. `ParsedEntity`
43+
Può essere di tipo:
44+
- [ ] `PEC`: nel caso in cui il messaggio rappresenta una PEC
45+
- [ ] `PECReceipt`: nel caso in cui il messaggio rappresenta una ricevuta PEC
46+
- [ ] `Mail`: nel caso in cui il messaggio rappresenta una semplice mail di posta ordinaria
47+
48+
### Altro
49+
- [ ] La libreria supporta l'elaborazione di messaggi di posta ordinaria con codifica [UUencode](https://en.wikipedia.org/wiki/Uuencoding)
50+
- [ ] La libreria è disponibile nel [catalogo Open Source di terze parti di Developers Italia](https://developers.italia.it/it/software/biagiot-java-pec-parser-09abab).
51+
52+
### Specifiche
53+
- [ ] Regole tecniche del servizio di trasmissione di documenti informatici mediante posta elettronica certificata: [pec_regole_tecniche_dm_2-nov-2005.pdf](https://www.agid.gov.it/sites/default/files/repository_files/leggi_decreti_direttive/pec_regole_tecniche_dm_2-nov-2005.pdf)
54+
55+
### Licenza
56+
57+
- [ ] La licenza è disponibile [qui](https://github.com/biagioT/java-pec-parser/blob/master/LICENSE).

README.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

build.gradle

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
plugins {
2+
id 'java-library'
3+
id 'maven-publish'
4+
id 'signing'
5+
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
6+
}
7+
8+
group = 'app.tozzi'
9+
version = '5.0.0'
10+
11+
java {
12+
sourceCompatibility = JavaVersion.VERSION_17
13+
targetCompatibility = JavaVersion.VERSION_17
14+
withSourcesJar()
15+
withJavadocJar()
16+
}
17+
18+
repositories {
19+
mavenCentral()
20+
}
21+
22+
dependencies {
23+
// Java Mail
24+
implementation 'jakarta.mail:jakarta.mail-api:2.1.3'
25+
implementation 'org.eclipse.angus:angus-mail:2.0.3'
26+
27+
// Java Activation
28+
implementation 'jakarta.activation:jakarta.activation-api:2.1.3'
29+
runtimeOnly 'org.eclipse.angus:angus-activation:2.0.2'
30+
31+
// Lombok
32+
compileOnly 'org.projectlombok:lombok:1.18.34'
33+
annotationProcessor 'org.projectlombok:lombok:1.18.34'
34+
35+
// Log
36+
implementation 'org.slf4j:slf4j-api:2.0.16'
37+
38+
// Utils
39+
implementation 'org.apache.commons:commons-lang3:3.17.0'
40+
41+
// XML
42+
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.2'
43+
44+
// Test
45+
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.3'
46+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
47+
testImplementation 'org.mockito:mockito-core:5.14.2'
48+
testImplementation 'org.projectlombok:lombok:1.18.34'
49+
testCompileOnly 'org.projectlombok:lombok:1.18.34'
50+
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
51+
}
52+
53+
tasks.withType(JavaCompile) {
54+
options.encoding = 'UTF-8'
55+
}
56+
57+
publishing {
58+
publications {
59+
maven(MavenPublication) {
60+
group = 'app.tozzi'
61+
artifactId = 'pec-parser'
62+
version = "5.0.0"
63+
from components.java
64+
pom {
65+
name = 'pec-parser'
66+
description = 'Utility per l\'elaborazione di messaggi di Posta Elettronica Certificata (e messaggi di posta ordinaria)'
67+
url = 'https://www.tozzi.app'
68+
69+
licenses {
70+
license {
71+
name = 'Apache License 2.0'
72+
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
73+
}
74+
}
75+
76+
developers {
77+
developer {
78+
id = 'biagio.tozzi'
79+
name = 'Biagio Placido Tozzi'
80+
email = 'biagio.tozzi@gmail.com'
81+
url = 'https://www.tozzi.app'
82+
}
83+
}
84+
85+
scm {
86+
connection = 'scm:git:git://github.com:biagioT/java-pec-parser.git'
87+
developerConnection = 'scm:git:ssh://github.com:biagioT/java-pec-parser.git'
88+
url = 'https://github.com/biagioT/java-pec-parser/tree/main'
89+
}
90+
}
91+
}
92+
}
93+
94+
repositories {
95+
maven {
96+
name "ossrh"
97+
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
98+
credentials {
99+
username = project.findProperty("sonatypeUsername") ?: System.getenv("SONATYPE_USER")
100+
password = project.findProperty("sonatypePassword") ?: System.getenv("SONATYPE_TOKEN")
101+
}
102+
}
103+
}
104+
}
105+
106+
signing {
107+
useGpgCmd()
108+
sign publishing.publications.maven
109+
}
110+
111+
javadoc {
112+
options.addBooleanOption('html5', true)
113+
options.encoding = 'UTF-8'
114+
}
115+
116+
test {
117+
useJUnitPlatform()
118+
}
119+
120+
jar {
121+
from sourceSets.main.allSource
122+
}

gradle/wrapper/gradle-wrapper.jar

42.6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)