-2

I am trying to create an executable jar file for deploy in Intellij Idea Instead of that "mvn clean package" starts an application (that is working for sure) but there is no jar file in \target (i also need dependencies included) What am I doing wrong?

Pom is below:

<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.3.1</version>
    <relativePath/> 
</parent>
<groupId>rb</groupId>
<artifactId>Bot</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>Bot</name>
<description>Bot</description>
<url/>
<licenses>
    <license/>
</licenses>
<developers>
    <developer/>
</developers>
<scm>
    <connection/>
    <developerConnection/>
    <tag/>
    <url/>
</scm>
<properties>
    <java.version>17</java.version>
    <boot.version>3.3.1</boot.version>
    <start-class>rb.bot.Bot</start-class>
</properties>
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.telegram</groupId>
        <artifactId>telegrambots</artifactId>
        <version>6.8.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.zaxxer/HikariCP -->
    <dependency>
        <groupId>com.zaxxer</groupId>
        <artifactId>HikariCP</artifactId>
        <version>5.1.0</version>
    </dependency>

</dependencies>

<build>
    <plugins>
     
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <!--configuration>
                <excludes>
                    <exclude>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok</artifactId>
                    </exclude>
                </excludes>
            </configuration-->
        </plugin>
      
    </plugins>
</build>

I am expecting executable jar file is created

3
  • I don't understand what you mean with the "instead of that mvn clean package". From that sentence, it sounds to me that it is creating a JAR file if you run the maven command. Is it? And if it is, then what are you doing that isn't working? Commented Jul 6 at 21:01
  • 1
    this configuration would absolutely produce a jar under target folder, so I have no idea what you are talking about. The only thing i can think of is that you have some IDE configurations that you are confusing, execute mvn clean package in commandline and check the result. Additionally sometimes (for example in Intellij) you need to right click on folder - and select Reload from Disk for IDE to show file changes
    – J Asgarov
    Commented Jul 6 at 21:08
  • "mvn clean package" starts an application You're getting confused. That command won't start anything
    – g00se
    Commented Jul 6 at 21:22

0

Browse other questions tagged or ask your own question.