Home > database >  Could not find artifact net.sf.jasperreports:liberation-fonts:jar:1.0 in maven-central (https://repo
Could not find artifact net.sf.jasperreports:liberation-fonts:jar:1.0 in maven-central (https://repo

Time:08-14

Everything work ok with Spring Boot 2.7.2 . I tried Spring Boot 3 snapshot. My pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.0-SNAPSHOT</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>spring_jwt</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <name>spring-boot-security-jwt</name>
    <description>spring_jwt</description>
    <properties>
        <java.version>18</java.version>
    </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-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>0.11.5</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>0.11.5</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <version>0.11.5</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>4.0.0</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-hibernate5</artifactId>
            <version>2.13.3</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>1.6.9</version>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-security</artifactId>
            <version>1.6.9</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.11.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>6.20.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-fonts</artifactId>
            <version>6.20.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-functions</artifactId>
            <version>6.20.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-metadata</artifactId>
            <version>6.20.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-chart-themes</artifactId>
            <version>6.20.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-annotation-processors</artifactId>
            <version>6.20.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-castor</artifactId>
            <version>6.20.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>liberation-fonts</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-chart-customizers</artifactId>
            <version>6.20.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-custom-visualization</artifactId>
            <version>6.20.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.9.4</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>

<!--        <dependency>-->
<!--            <groupId>com.stimulsoft</groupId>-->
<!--            <artifactId>stimulsoft-reports-report</artifactId>-->
<!--            <version>2022.3.3</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>com.stimulsoft</groupId>-->
<!--            <artifactId>stimulsoft-reports-web</artifactId>-->
<!--            <version>2022.3.3</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>com.stimulsoft</groupId>-->
<!--            <artifactId>stimulsoft-reports-base</artifactId>-->
<!--            <version>2022.3.3</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>com.stimulsoft</groupId>-->
<!--            <artifactId>stimulsoft-reports-viewer</artifactId>-->
<!--            <version>2022.3.3</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>com.stimulsoft</groupId>-->
<!--            <artifactId>stimulsoft-reports-samples</artifactId>-->
<!--            <version>2022.3.3</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>com.stimulsoft</groupId>-->
<!--            <artifactId>stimulsoft-reports-webviewer</artifactId>-->
<!--            <version>2022.3.3</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>com.stimulsoft</groupId>-->
<!--            <artifactId>stimulsoft-reports-lib</artifactId>-->
<!--            <version>2022.3.3</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>com.stimulsoft</groupId>-->
<!--            <artifactId>stimulsoft-reports-webdesigner</artifactId>-->
<!--            <version>2022.3.3</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>com.stimulsoft</groupId>-->
<!--            <artifactId>reports</artifactId>-->
<!--            <version>2022.3.3</version>-->
<!--            <type>pom</type>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    <repositories>
        <repository>
            <id>maven-central</id>
            <name>Maven Central</name>
            <url>https://repo1.maven.org/maven2/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
</project>

error

Could not find artifact net.sf.jasperreports:liberation-fonts:jar:1.0 in maven-central (https://repo1.maven.org/maven2/)

Try to run Maven import with -U flag (force update snapshots)

If run maven with -U flag

Could not find artifact net.sf.jasperreports:liberation-fonts:pom:1.0 in maven-central (https://repo1.maven.org/maven2/)
Could not find artifact net.sf.jasperreports:liberation-fonts:pom:1.0 in maven-central (https://repo1.maven.org/maven2/)

Related https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports-fonts/6.20.0

How to fix it?

CodePudding user response:

Use

<!-- https://mvnrepository.com/artifact/com.mpobjects.jasperreports.font/jasperreports-fonts-liberation -->
<dependency>
    <groupId>com.mpobjects.jasperreports.font</groupId>
    <artifactId>jasperreports-fonts-liberation</artifactId>
    <version>2.1.2</version>
</dependency>

CodePudding user response:

You have explicitly defined a dependency:

<dependency>
  <groupId>net.sf.jasperreports</groupId>
  <artifactId>liberation-fonts</artifactId>
  <version>1.0</version>
</dependency>

which obviously does not exist.. So you should use dependencies which do really exists instead of those who do not... for example

https://search.maven.org/artifact/com.mpobjects.jasperreports.font/jasperreports-fonts-liberation

Further hints:

  • You should remove the repositories from your pom file because you are referencing milestone repositories which are not allowed to access from outside for a longer time. Furthermore the entry repo1.maven.org is the default which is used by Maven.
 <repositories>
    <repository>
        <id>maven-central</id>
        <name>Maven Central</name>
        <url>https://repo1.maven.org/maven2/</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <releases>
            <enabled>false</enabled>
        </releases>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <releases>
            <enabled>false</enabled>
        </releases>
    </pluginRepository>
</pluginRepositories>

For more details on access to milestone repositories:

  • Related