build 并deploy saiku-query0.4到nexus

参考关于0.1版本的构建过程: http://blog.csdn.net/gsying1474/article/details/51361987

修改pom文件
其中,红色的为原有被注释的
绿色的为添加的
蓝色地方比较重要,在saiku-query的0.4版本中,居然依赖了0.1的版本,但是源码中却没有相关0.1的分支或者标签,所以此处可以注释,打包也成功了,但是是否存在不稳定或者不全的现象,尚未可知


修改后如下:
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.saiku</groupId>
    <artifactId>saiku-query</artifactId>
    <version>0.4-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>query</name>
    <url> http://maven.apache.org</url>

    <!-- <distributionManagement>
        <repository>
            <id>deployment</id>
            <name>Internal Releases</name>
        </repository>
        <snapshotRepository>
            <id>deployment</id>
            <name>Internal Snapshots</name>
        </snapshotRepository>
    </distributionManagement> -->
     <distributionManagement>
        <snapshotRepository>
            <id>snapshots-host</id>
        </snapshotRepository>
    </distributionManagement>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>        
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
                <configuration>
                    <argLine> -Xmx512m</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>test</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo message="Prepare Test. Unzipping foodmart" />
                                <unzip dest="target/test-classes/">
                                    <fileset dir="lib/">
                                        <include name="mondrian-data*.jar" />
                                    </fileset>
                                </unzip>
                                <echo message="Unzipped!" />
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
    <repositories>
         <repository>
            <id>mine</id>
            <name>public Releases</name>
            <url>http://192.168.10.140:8081/nexus/content/groups/public/</url>
        </repository>
         <!-- <repository>
            <id>pentaho-third-party</id>
        </repository>
        <repository>
            <id>pentaho-public-release</id>
        </repository> -->
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.olap4j</groupId>
            <artifactId>olap4j</artifactId>
            <version>1.2.0</version>
            <exclusions>
                <exclusion>
                    <groupId>asm</groupId>
                    <artifactId>asm</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>asm</groupId>
                    <artifactId>asm-commons</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>retroweaver</groupId>
                    <artifactId>retroweaver</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>retroweaver</groupId>
                    <artifactId>retroweaver-rt</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>pentaho</groupId>
            <artifactId>mondrian</artifactId>
            <version>3.9.0.2</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>jsp-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
           <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.4</version>
            </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.17</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>1.8.0.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
         <dependency>
            <groupId>org.saiku</groupId>
            <artifactId>saiku-query</artifactId>
            <version>0.1-SNAPSHOT</version>
        </dependency> 
    </dependencies>
</project>


by 刘迎光
saiku 研究学习交流群: 495266201

Maven 项目中,`build.bat deploy -pl` 是一个组合命令,涉及 Maven 的 `deploy` 目标和 `-pl`(或 `--projects`)选项的使用。该命令通常用于在多模块 Maven 项目中部署特定模块到远程仓库,例如私有仓库或快照仓库。 ### deploy 命令的作用 Maven 的 `deploy` 目标用于将构建好的项目(通常是 JAR、WAR 或其他打包格式)上传到远程仓库。这一操作通常发生在持续集成/交付(CI/CD)流程的最后阶段,以确保其他项目可以引用和使用该项目的构建产物。`deploy` 操作通常包括将项目部署到快照仓库(Snapshots)或发布仓库(Releases),具体取决于项目的版本号是否包含 `SNAPSHOT` 标识[^2]。 ### -pl(--projects)选项的含义 `-pl` 是 `--projects` 的缩写,它允许指定要在多模块项目中操作的特定模块。例如,在一个包含多个子模块的项目中,可以使用 `-pl` 来限定只对某个或某些模块执行操作。例如: ``` mvn deploy -pl module-name ``` 该命令将仅对 `module-name` 子模块执行 `deploy` 操作。如果该模块依赖于其他模块,则可以通过 `-am`(`--also-make`)选项一构建这些依赖模块[^2]。 ### build.bat 中 deploy -pl 命令的典型用法 在实际的 `build.bat` 脚本中,`deploy -pl` 命令可能与 `-am` 和 `-DaltDeploymentRepository` 等参数结合使用,以确保在部署特定模块时,其依赖项也被处理,且部署到指定的远程仓库。例如: ``` mvn -U -Dmaven.test.skip=true -Dautconfig.skip clean deploy -pl bigdata-process-sev-service-api -am -DaltDeploymentRepository=snapshots::default::http://mavenrepository.bestpay.com.cn/content/repositories/snapshots/ ``` 这条命令的作用是: - `-U`:强制更新快照依赖。 - `-Dmaven.test.skip=true`:跳过测试阶段。 - `clean deploy`:清理部署项目。 - `-pl bigdata-process-sev-service-api`:仅对 `bigdata-process-sev-service-api` 模块进行操作。 - `-am`:同时构建该模块所依赖的其他模块。 - `-DaltDeploymentRepository`:指定部署的目标仓库为私有快照仓库。 ### 总结 `build.bat deploy -pl` 命令主要用于在多模块 Maven 项目中部署特定模块及其依赖项到指定的远程仓库,从而实现高效的模块化构建和部署流程。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值