Skip to content

Commit 32643a9

Browse files
committed
removing the extra plugins since they are not necessary.
1 parent 8d140fb commit 32643a9

2 files changed

Lines changed: 46 additions & 91 deletions

File tree

Lines changed: 44 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
<modelVersion>4.0.0</modelVersion>
6-
<artifactId>core-java-networking-3</artifactId>
7-
<name>core-java-networking-3</name>
8-
<packaging>jar</packaging>
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<artifactId>core-java-networking-3</artifactId>
7+
<name>core-java-networking-3</name>
8+
<packaging>jar</packaging>
99

10-
<parent>
11-
<groupId>com.baeldung.core-java-modules</groupId>
12-
<artifactId>core-java-modules</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
14-
<relativePath>../pom.xml</relativePath>
15-
</parent>
10+
<parent>
11+
<groupId>com.baeldung.core-java-modules</groupId>
12+
<artifactId>core-java-modules</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
14+
<relativePath>../pom.xml</relativePath>
15+
</parent>
1616

17-
<dependencies>
18-
<dependency>
19-
<groupId>org.springframework</groupId>
20-
<artifactId>spring-core</artifactId>
21-
<version>${spring.core.version}</version>
22-
</dependency>
23-
<dependency>
24-
<groupId>org.eclipse.jetty</groupId>
25-
<artifactId>jetty-server</artifactId>
26-
<version>${jetty.embeded.version}</version>
27-
</dependency>
28-
<dependency>
29-
<groupId>org.apache.tomcat.embed</groupId>
30-
<artifactId>tomcat-embed-core</artifactId>
31-
<version>${tomcat.embeded.version}</version>
32-
</dependency>
33-
<dependency>
34-
<groupId>org.assertj</groupId>
35-
<artifactId>assertj-core</artifactId>
36-
<version>${assertj.version}</version>
37-
<scope>test</scope>
38-
</dependency>
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.springframework</groupId>
20+
<artifactId>spring-core</artifactId>
21+
<version>${spring.core.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.eclipse.jetty</groupId>
25+
<artifactId>jetty-server</artifactId>
26+
<version>${jetty.embeded.version}</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.apache.tomcat.embed</groupId>
30+
<artifactId>tomcat-embed-core</artifactId>
31+
<version>${tomcat.embeded.version}</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.assertj</groupId>
35+
<artifactId>assertj-core</artifactId>
36+
<version>${assertj.version}</version>
37+
<scope>test</scope>
38+
</dependency>
3939
<dependency>
4040
<groupId>junit</groupId>
4141
<artifactId>junit</artifactId>
@@ -47,70 +47,25 @@
4747
<artifactId>javax.mail</artifactId>
4848
<version>1.6.2</version>
4949
</dependency>
50-
</dependencies>
50+
</dependencies>
5151

52-
<build>
53-
<finalName>core-java-networking-3</finalName>
52+
<build>
53+
<finalName>core-java-networking-3</finalName>
5454
<pluginManagement>
55-
<!-- lock down plugins versions to avoid using Maven defaults (may be
56-
moved to parent pom) -->
5755
<plugins>
58-
<plugin>
59-
<groupId>org.apache.maven.plugins</groupId>
60-
<artifactId>maven-compiler-plugin</artifactId>
61-
</plugin>
62-
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
6356
<plugin>
6457
<groupId>org.apache.maven.plugins</groupId>
6558
<artifactId>maven-compiler-plugin</artifactId>
6659
</plugin>
67-
<plugin>
68-
<artifactId>maven-clean-plugin</artifactId>
69-
<version>3.1.0</version>
70-
</plugin>
71-
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
72-
<plugin>
73-
<artifactId>maven-resources-plugin</artifactId>
74-
<version>3.0.2</version>
75-
</plugin>
76-
<plugin>
77-
<artifactId>maven-compiler-plugin</artifactId>
78-
<version>3.8.0</version>
79-
</plugin>
80-
<plugin>
81-
<artifactId>maven-surefire-plugin</artifactId>
82-
<version>2.22.1</version>
83-
</plugin>
84-
<plugin>
85-
<artifactId>maven-jar-plugin</artifactId>
86-
<version>3.0.2</version>
87-
</plugin>
88-
<plugin>
89-
<artifactId>maven-install-plugin</artifactId>
90-
<version>2.5.2</version>
91-
</plugin>
92-
<plugin>
93-
<artifactId>maven-deploy-plugin</artifactId>
94-
<version>2.8.2</version>
95-
</plugin>
96-
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
97-
<plugin>
98-
<artifactId>maven-site-plugin</artifactId>
99-
<version>3.7.1</version>
100-
</plugin>
101-
<plugin>
102-
<artifactId>maven-project-info-reports-plugin</artifactId>
103-
<version>3.0.0</version>
104-
</plugin>
10560
</plugins>
10661
</pluginManagement>
107-
</build>
62+
</build>
10863

109-
<properties>
110-
<spring.core.version>5.2.8.RELEASE</spring.core.version>
111-
<jetty.embeded.version>9.4.31.v20200723</jetty.embeded.version>
112-
<tomcat.embeded.version>10.0.0-M7</tomcat.embeded.version>
113-
<assertj.version>3.11.1</assertj.version>
114-
</properties>
64+
<properties>
65+
<spring.core.version>5.2.8.RELEASE</spring.core.version>
66+
<jetty.embeded.version>9.4.31.v20200723</jetty.embeded.version>
67+
<tomcat.embeded.version>10.0.0-M7</tomcat.embeded.version>
68+
<assertj.version>3.11.1</assertj.version>
69+
</properties>
11570

11671
</project>

core-java-modules/core-java-networking-3/src/main/java/com/baeldung/downloadAttachments/DownloadEmailAttachments.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void downloadEmailAttachments(String host, String port, String userName,
4040
List<String> attachments = new ArrayList<String>();
4141
if (message.getContentType()
4242
.contains("multipart")) {
43-
attachments = downloadEmailMessages(message);
43+
attachments = downloadAttachments(message);
4444
}
4545

4646
System.out.println("Message #" + (i + 1) + ":");
@@ -53,7 +53,7 @@ public void downloadEmailAttachments(String host, String port, String userName,
5353
store.close();
5454
}
5555

56-
public List<String> downloadEmailMessages(Message message) throws IOException, MessagingException {
56+
public List<String> downloadAttachments(Message message) throws IOException, MessagingException {
5757
List<String> downloadedAttachments = new ArrayList<String>();
5858
Multipart multiPart = (Multipart) message.getContent();
5959
int numberOfParts = multiPart.getCount();

0 commit comments

Comments
 (0)