This commit is contained in:
Mikołaj Gulczyński 2023-10-28 15:08:47 +02:00
parent 161950de5c
commit 701f5b4512
4 changed files with 48 additions and 23 deletions

63
pom.xml
View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId> <groupId>org.example</groupId>
<artifactId>Pracownia2020-2021</artifactId> <artifactId>Pracownia2024</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<properties> <properties>
@ -13,23 +13,6 @@
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
</properties> </properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>introduction.HelloWorld</mainClass>>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
@ -37,4 +20,46 @@
<version>1.2.17</version> <version>1.2.17</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>introduction.HelloWorld</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>assemble-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -3,10 +3,10 @@ package introduction;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
public class HelloWorld { public class HelloWorld {
static Logger log = Logger.getLogger("name"); static Logger log = Logger.getLogger("name");
public static void main(String[] args) { public static void main(String [ ] args) {
System.out.println("Hello World!");{ System.out.println("Hello! Witaj!");
log.info("message"); log.info("Message");
}
} }
} }

Binary file not shown.