Skip to content

Commit 2bc067d

Browse files
committed
Update maven intro project.
1 parent 96e02b3 commit 2bc067d

File tree

2 files changed

+50
-76
lines changed

2 files changed

+50
-76
lines changed
Lines changed: 28 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,37 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<project xmlns="http://maven.apache.org/POM/4.0.0" 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>
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
65

7-
<groupId>com.unloadbrain</groupId>
8-
<artifactId>hello-world</artifactId>
9-
<version>1.0-SNAPSHOT</version>
6+
<modelVersion>4.0.0</modelVersion>
107

11-
<name>hello-world</name>
12-
<!-- FIXME change it to the project's website -->
13-
<url>http://www.example.com</url>
8+
<groupId>com.unloadbrain</groupId>
9+
<artifactId>hello-world</artifactId>
10+
<version>1.0-SNAPSHOT</version>
1411

15-
<properties>
16-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17-
<maven.compiler.source>1.7</maven.compiler.source>
18-
<maven.compiler.target>1.7</maven.compiler.target>
19-
</properties>
12+
<name>hello-world</name>
2013

21-
<dependencies>
22-
<dependency>
23-
<groupId>junit</groupId>
24-
<artifactId>junit</artifactId>
25-
<version>4.11</version>
26-
<scope>test</scope>
27-
</dependency>
28-
</dependencies>
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<maven.compiler.source>1.7</maven.compiler.source>
17+
<maven.compiler.target>1.7</maven.compiler.target>
18+
</properties>
19+
20+
<dependencies>
21+
22+
<dependency>
23+
<groupId>org.jsoup</groupId>
24+
<artifactId>jsoup</artifactId>
25+
<version>1.13.1</version>
26+
</dependency>
27+
28+
<dependency>
29+
<groupId>junit</groupId>
30+
<artifactId>junit</artifactId>
31+
<version>4.11</version>
32+
<scope>test</scope>
33+
</dependency>
34+
35+
</dependencies>
2936

30-
<build>
31-
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
32-
<plugins>
33-
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
34-
<plugin>
35-
<artifactId>maven-clean-plugin</artifactId>
36-
<version>3.1.0</version>
37-
</plugin>
38-
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
39-
<plugin>
40-
<artifactId>maven-resources-plugin</artifactId>
41-
<version>3.0.2</version>
42-
</plugin>
43-
<plugin>
44-
<artifactId>maven-compiler-plugin</artifactId>
45-
<version>3.8.0</version>
46-
</plugin>
47-
<plugin>
48-
<artifactId>maven-surefire-plugin</artifactId>
49-
<version>2.22.1</version>
50-
</plugin>
51-
<plugin>
52-
<artifactId>maven-jar-plugin</artifactId>
53-
<version>3.0.2</version>
54-
</plugin>
55-
<plugin>
56-
<artifactId>maven-install-plugin</artifactId>
57-
<version>2.5.2</version>
58-
</plugin>
59-
<plugin>
60-
<artifactId>maven-deploy-plugin</artifactId>
61-
<version>2.8.2</version>
62-
</plugin>
63-
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
64-
<plugin>
65-
<artifactId>maven-site-plugin</artifactId>
66-
<version>3.7.1</version>
67-
</plugin>
68-
<plugin>
69-
<artifactId>maven-project-info-reports-plugin</artifactId>
70-
<version>3.0.0</version>
71-
</plugin>
72-
</plugins>
73-
</pluginManagement>
74-
</build>
7537
</project>
Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
package com.unloadbrain;
22

3-
/**
4-
* Hello world!
5-
*
6-
*/
7-
public class App
8-
{
9-
public static void main( String[] args )
10-
{
11-
System.out.println( "Hello World!" );
12-
}
3+
4+
import org.jsoup.Jsoup;
5+
import org.jsoup.nodes.Document;
6+
7+
import java.io.IOException;
8+
import java.net.URL;
9+
10+
public class App {
11+
12+
public static void main(String[] args) {
13+
14+
System.out.println("Hello World!");
15+
16+
Document prothomAloPage;
17+
try {
18+
prothomAloPage = Jsoup.parse(new URL("https://www.prothomalo.com/"), 10000);
19+
} catch (IOException e) {
20+
throw new RuntimeException("Could not download document.", e);
21+
}
22+
23+
System.out.println(prothomAloPage.select("#header time").text());
24+
}
1325
}

0 commit comments

Comments
 (0)