я создал библиотеку Java Spring для аудита и времени выполнения журнала во время выполнения моего приложения.
Я развернул ее на сонатип и загружаю ее как зависимость в демонстрационном проекте. < /p>
Проплетии моей библиотеки не может быть решена, даже если я добавляю файл Auto-config и файл Propreties в Propreties file-файл и Propreties file-файл и Propreties file-файл. Propreties file-файл. /> Вот pom.xml моей библиотеки. < /p>
Код: Выделить всё
4.0.0
org.springframework.boot
spring-boot-starter-parent
3.4.5
io.github.speedkillsx
checkcommonlib
0.0.5
Check Common Library
Demo project for Spring Boot
jar
The Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0.txt
repo
scm:git:git://github.com/speedKillsx/checkcommonlib.git
scm:git:ssh://git@github.com/speedKillsx/checkcommonlib.git
https://github.com/speedKillsx/checkcommonlib
HEAD
17
org.springframework.boot
spring-boot-starter-web
org.projectlombok
lombok
true
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-starter-aop
org.apache.maven.plugins
maven-compiler-plugin
org.projectlombok
lombok
org.sonatype.central
central-publishing-maven-plugin
0.7.0
true
ossrh
true
published
org.apache.maven.plugins
maven-javadoc-plugin
3.6.3
attach-javadocs
jar
org.apache.maven.plugins
maven-source-plugin
3.2.1
attach-sources
jar
org.apache.maven.plugins
maven-gpg-plugin
1.5
sign-artifacts
verify
sign
ossrh
https://oss.sonatype.org/service/local/staging/deploy/maven2/
ossrh
https://oss.sonatype.org/content/repositories/snapshots/
< /code>
Мой файл автоконфигурации в библиотеке: < /p>
package io.github.speedkillsx.checkcommonlib.config;
import io.github.speedkillsx.checkcommonlib.properties.AuditProperties;
import io.github.speedkillsx.checkcommonlib.properties.LogExecutionTimeProperties;
import io.github.speedkillsx.checkcommonlib.properties.RetryOnFailurePropreties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
/**
* CheckCommonAutoConfiguration is a Spring configuration class that
* auto-configures beans related to common functionalities such as
* auditing, logging execution time, and retry mechanisms. These functionalities
* are managed through properties prefixed with "check-common" and loaded from
* the application's configuration file.
*
* It integrates configuration support for the following types of properties:
* - {@link AuditProperties} for enabling or disabling auditing features.
* - {@link LogExecutionTimeProperties} for enabling or disabling method execution time logging.
* - {@link RetryOnFailurePropreties} for configuring retry mechanisms in case of failures.
*
* The class enables AspectJ auto-proxy support and ensures that the
* necessary configuration beans are available for components relying on
* these common features.
*/
@Configuration
@EnableConfigurationProperties({
AuditProperties.class,
LogExecutionTimeProperties.class,
RetryOnFailurePropreties.class
})
@EnableAspectJAutoProxy
public class CheckCommonAutoConfiguration {
}
< /code>
Файлы свойств: < /pbr /> @Getter
@Setter
@ConfigurationProperties(prefix = "check-common")
public class AuditProperties {
private boolean auditEnable;
}
@Getter
@Setter
@ConfigurationProperties(prefix = "check-common.retry")
public class RetryOnFailurePropreties {
private boolean enabled;
private int defaultMaxAttempts;
private long defaultDelayMs;
}
@Getter
@Setter
@ConfigurationProperties(prefix = "check-common")
public class LogExecutionTimeProperties {
private boolean logExecutionTime;
}
< /code>
У меня есть пустое приложение. YAML и Application-local.yaml в библиотеке. < /p>
Для моего демонстрационного приложения я добавил библиотеку в качестве зависимости: < /p>
< /p>
Подробнее здесь: [url]https://stackoverflow.com/questions/79605952/cannot-apply-my-library-propreties-in-spring-boot-application[/url]