小编Ely*_*ahu的帖子

Maven:如果属性标签中的pom.xml中的sentense

如果设置了环境变量,我想设置属性.我搜索了很多内容,我发现的所有内容都类似于下面的代码,但我不断收到错误:

[致命]不可解析的POM Y:\ Maven\parent-pom\pom.xml:TEXT必须紧跟END_TAG而不是START_TAG(位置:START_TAG s een ... roperties"\ r \n
classpathref ="maven. plugin.classpath"/> ... @ 29:55)@第29行,第55栏

这是我正在尝试的代码,它在pom.xml中,我运行命令 -

mvn --errors deploy

当然,如果您有关于如何根据环境变量内容在pom.xml中设置属性的其他建议,我将很乐意获得任何其他解决方案.

谢谢,Eli

    <distributionManagement>
       .....
    </distributionManagement>

    <properties>
          <tasks>
        <taskdef resource="net/sf/antcontrib/antcontrib.properties"
          classpathref="maven.plugin.classpath" />

        <if>
           <condition>
             <equals arg1="${env.WAS60_HOME}" arg2=""\>
           </condition>
           <then>
             <was60.home>${env.WAS60_HOME}</was60.home>
             <javac>${was60.home}/java/bin/javac</javac>
           </then>
        </if>

         <if>
           <condition>
             <equals arg1="${env.WAS85_HOME}" arg2=""\>
           </condition>
           <then>
             <was85.home>${env.WAS85_HOME}</was60.home>
             <javac>${was85.home}/java/bin/javac</javac>
           </then>
        </if>
      </tasks>
</properties>
    <profiles>
       <profile>
    <id>was.base.v60</id>
            <dependencies>
               <dependency>
                 ....
                  <systemPath>${was60.home}/java/jre/lib/xml.jar</systemPath>
               </dependency>
               .....
            </dependencies>
        </profile>
        <profile>
    <id>was.base.v85</id>
            <dependencies>
               <dependency>
                 ....
                  <systemPath>${was85.home}/java/jre/lib/xml.jar</systemPath>
               </dependency>
               .....
            </dependencies>
        </profile>
    </profiles>
Run Code Online (Sandbox Code Playgroud)

xml if-statement pom.xml maven sentence

6
推荐指数
2
解决办法
3万
查看次数

如何防止删除纯 GIT 中的远程分支

问题在于PURE GIT,而不是 GitHub、GitBucket、GitLab 等。

有没有办法使用钩子或其他任何东西,我可以捕捉到某人试图删除远程分支的命令?

类似于命令“push --delete origin branchName”

预推送或更新挂钩,不知道是否执行了“删除”。

很奇怪,不小心或不理解某人可以非常简单地删除甚至像“master”这样的主要分支。一切都可以恢复是正确的,但为什么要这么麻烦?我没办法将它标记为受保护的,或者至少是一些我可以检查它是否正在完成的钩子?

我们只使用 Git 和 GitExtentions,使用简单的 http,我们不会切换到其他工具。

谢谢,伊莱。

git hook git-extensions atlassian-sourcetree

3
推荐指数
1
解决办法
1172
查看次数