简体   繁体   English

Maven:scm url不包含有效的定界符

[英]Maven: The scm url does not contain a valid delimiter

I'm trying to get automatic buildNumers working but I keep running into the error 我正在尝试使自动buildNumers工作,但我一直遇到错误

The scm url does not contain a valid delimiter scm url不包含有效的定界符

Here's the relevant part of the pom. 这是pom的相关部分。

<scm>
    <connection>scm:svn:${source.repo}</connection>
    <developerConnection>scm:svn:${source.repo}</developerConnection>
    <url>${source.repo}</url>
</scm>
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>buildnumber-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
        <execution>
            <phase>validate</phase>        
            <goals>
                <goal>create</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <revisionOnScmFailure>1</revisionOnScmFailure>
        <format>{0,number}</format>
        <items>
            <item>buildNumber0</item>
        </items>
    </configuration>
</plugin>
<properties>
    <source.repo>svn://myserver/repository/${project.artifactId}</source.repo>
    [..]
</properties>

The subversion location contains two sub projects core and web. Subversion位置包含两个子项目core和web。

If anyone can help, I feel like I've tried everything. 如果有人可以帮助,我觉得我已经尝试了一切。

I've tried the following: 我尝试了以下方法:

  • using pipes: invalid url 使用管道:无效的网址
  • retrieving a list of items from the server using the repo url from the command line: works fine 使用命令行中的仓库网址从服务器中检索项目列表:工作正常
  • adding /trunk to the repo url: delimiter error 将/ trunk添加到仓库URL:分隔符错误
  • adding /trunk/core to the repo url: delimiter error 将/ trunk / core添加到仓库URL:分隔符错误
  • adding /trunk/web to the repo url: delimiter error 将/ trunk / web添加到仓库URL:分隔符错误

The delimiter error is probably hiding a different error because I dont think the url is wrong. 分隔符错误可能隐藏了另一个错误,因为我认为URL错误。

Here's the stack 这是堆栈

java.lang.IllegalArgumentException: The scm url does not contain a valid delimit
    er.
            at org.apache.maven.scm.provider.ScmUrlUtils.getDelimiter(ScmUrlUtils.ja
    va:61)
            at org.apache.maven.scm.manager.AbstractScmManager.makeScmRepository(Abs
    tractScmManager.java:186)
            at org.codehaus.mojo.build.CreateMojo.getScmRepository(CreateMojo.java:7
    68)
            at org.codehaus.mojo.build.CreateMojo.getScmBranch(CreateMojo.java:619)
            at org.codehaus.mojo.build.CreateMojo.execute(CreateMojo.java:464)
            at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
    nManager.java:490)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
    ultLifecycleExecutor.java:694)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
    fecycle(DefaultLifecycleExecutor.java:556)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
    ltLifecycleExecutor.java:535)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
    dleFailures(DefaultLifecycleExecutor.java:387)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
    ts(DefaultLifecycleExecutor.java:348)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
    fecycleExecutor.java:180)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
            at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
    0)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
            at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
            at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

            at org.codehaus.classworlds.Launcher.main(Launcher.java:375)    

Thanks, Marc 谢谢,马克

It is possibly because you are using a placeholder in the URI, and Maven is not expanding it before using it. 可能是因为您在URI中使用了占位符,而Maven在使用它之前并未对其进行扩展。

I've battled this kind of thing myself with Maven, and sometimes you just have to give up and do the expansion by hand. 我自己曾与Maven进行过此类斗争,有时您只需要放弃并手动进行扩展即可。


Another possibility was that the expanded URL scm:svn:svn://myserver/repository/.... was wrong, but @ach_l's comment convinces me that's not the problem. 另一种可能是扩展的URL scm:svn:svn://myserver/repository/....是错误的,但是@ach_l的注释使我确信这不是问题。

Try running the command: 尝试运行命令:

mvn help:effective-pom

And check the output. 并检查输出。 That and the other help commands should help you trouble-shoot your Maven settings (eg expression evaluation, profiles, etc.) 命令和其他帮助命令应该可以帮助您解决Maven设置的问题(例如,表达式求值,配置文件等)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM