首页 > 解决方案 > maven maven-bundle-plugin - Bundle-Version 的值无效

问题描述

不知何故,maven-bundle-plugin 的“默认”版本正则表达式不允许我使用这样的版本号。

2.0.2021102095

1.1.2021102555

但它像这样接受这些版本。

2.0.202110201

2.0.20211020101

2.0.202110209999

2.0.2021102099991-快照

这是我在不接受版本号时遇到的错误。验证给定的正则表达式版本应该被接受,但不知何故它不是。

尝试了 maven-bundle-plugin 的几个版本,但这没有任何区别。

有人懂这个吗?有没有办法覆盖版本正则表达式?

谢谢。

[ERROR] Bundle xslt.CustomXSLTMediator:CustomXSLTMediator:bundle:2.0.2021102095 : Invalid value for Bundle-Version, 2.0.2021102095 does not match [0-9]{1,9}(\.[0-9]{1,9}(\.[0-9]{1,9}(\.[0-9A-Za-z_-]+)?)?)?
[ERROR] Error(s) found in bundle configuration
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.297 s
[INFO] Finished at: 2021-10-22T12:12:05+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:3.5.1:bundle (default-bundle) on project CustomXSLTMediator: Error(s) found in bundle configuration -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.felix:maven-bundle-plugin:3.5.1:bundle (default-bundle) on project CustomXSLTMediator: Error(s) found in bundle configuration
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>3.5.1</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>CustomXSLTMediator</Bundle-SymbolicName>
            <Bundle-Name>${project.name}</Bundle-Name>
            <!--<Bundle-Version>1.0.0.0</Bundle-Version> -->
            <Bundle-Version>${project.version}</Bundle-Version>
            <Export-Package>xslt</Export-Package>
            <DynamicImport-Package>*</DynamicImport-Package>
          </instructions>
        </configuration>
      </plugin>

标签: javamaven

解决方案


推荐阅读