我需要使用build.bat文件构建3个独立的maven项目(因为tycho聚合不是一个选项 - 请参阅romaintaz回答的评论).我试过(从build文件夹执行 - 见下文):
cd ../projectA
mvn clean install -U
cd ..
cd ../projectB
mvn clean install -U
cd ..
cd ../projectC
mvn clean install -U
Run Code Online (Sandbox Code Playgroud)
项目的文件夹结构是:
build
|--> build.bat
projectA
|--> pom.xml
projectB
|--> pom.xml
projectC
|--> pom.xml
Run Code Online (Sandbox Code Playgroud)
但只有projectA是构建projectB和projectC被跳过.关于如何修改上面的bat文件的任何想法,以便如果以前的项目成功构建,则构建以下项目?
问候!
我想通过文档函数从XSLT中的不同Maven POM中提取一些属性.脚本本身工作正常,但只要我在项目标记中有xmlns ="http://maven.apache.org/POM/4.0.0",文档函数就会为POM返回一个空结果.如果我删除它,一切正常.
任何想法如何使这个工作,同时将xmlns属性保留在它所属的位置或为什么这不适用于该属性?
这是我的XSLT的相关部分:
<xsl:template match="abcs">
<xsl:variable name="artifactCoordinate" select="abc"/>
<xsl:choose>
<xsl:when test="document(concat($artifactCoordinate,'-pom.xml'))">
<abc>
<ID><xsl:value-of select="$artifactCoordinate"/></ID>
<xsl:copy-of select="document(concat($artifactCoordinate,'-pom.xml'))/project/properties"/>
</abc>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
Transformation failed: POM "<xsl:value-of select="concat($artifactCoordinate,'-pom.xml')"/>" doesn't exist.
</xsl:message>
</xsl:otherwise>
</xsl:choose>
Run Code Online (Sandbox Code Playgroud)
并且,为了完整性,使用"坏"属性的POM提取:
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- ... -->
<properties>
<proalpha.version>[5.2a]</proalpha.version>
<proalpha.openedge.version>[10.1B]</proalpha.openedge.version>
<proalpha.optimierer.version>[1.1]</proalpha.optimierer.version>
<proalpha.sonic.version>[7.6.1]</proalpha.sonic.version>
</properties>
</project>
Run Code Online (Sandbox Code Playgroud) 我的XSL源文档看起来像这样
<Topology>
<Environment>
<Id>test</Id>
<Machines>
<Machine>
<Id>machine1</Id>
<modules>
<module>m1</module>
<module>m2</module>
</modules>
</Machine>
</Machines>
</Environment>
<Environment>
<Id>production</Id>
<Machines>
<Machine>
<Id>machine1</Id>
<modules>
<module>m1</module>
<module>m2</module>
</modules>
</Machine>
<Machine>
<Id>machine2</Id>
<modules>
<module>m3</module>
<module>m4</module>
</modules>
</Machine>
</Machines>
</Environment>
</Topology>
Run Code Online (Sandbox Code Playgroud)
我想为每台机器创建一个结果文档,因此我使用以下样式表给出modelDir作为result-documents的路径作为参数.
<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes" name="myXML" doctype-system="http://java.sun.com/dtd/properties.dtd"/>
<xsl:template match="/">
<xsl:for-each-group select="/Topology/Environment/Machines/Machine" group-by="Id">
<xsl:variable name="machine" select="Id"/>
<xsl:variable name="filename" select="concat($modelDir,$machine,'.xml')" />
<xsl:message terminate="no">Writing machine description to <xsl:value-of select="$filename"/></xsl:message>
<xsl:result-document href="$filename" format="myXML">
<xsl:variable name="currentMachine" select="Id"/>
<xsl:for-each select="current-group()/LogicalHosts/LogicalHost">
<xsl:variable name="environment" select="normalize-space(../../../../Id)"/>
<xsl:message terminate="no">Module <xsl:value-of select="."/> for <xsl:value-of select="$environment"/></xsl:message>
</xsl:for-each> …Run Code Online (Sandbox Code Playgroud)