저는 현재 Maven을 사용하여 Alfresco를 만들고 있습니다. 내 주머니에는 몇 개의 하위 아빠가 있는데 그 중 하나는 지금 당장 SNAPSHOT-1.0입니다.Maven 빌드에서 Jenkins를 사용할 때 pom 파일의 버전이 추가 된 이슈의 명명 규칙을 어떻게 대체합니까?
명령 줄에서 mvn을 설치하면 /target/.war에 war 파일이 생기지 만 Jenkins에서 빌드하면 -SNAPSHOT-1.0.war라는 인공물이 생깁니다. 작업 공간에서 그들은 여전히 .war이지만 Jenkins는 어떤 이유로 maven 버전을 추가하여 인공물을 만듭니다.
이러한 전쟁을 응용 프로그램 서버 (지금은 ssh 배포로 제한됨)에 배포하려는 경우 올바른 컨텍스트 루트와 함께 배포되도록 먼저 이름을 바꿔야합니다.
다른 빌드 작업에 인공물을 일반 이름으로 버전 번호없이 사용할 수있게 할 여지가 있습니까? 지금 당장에는 인공물을 복사하고 배포하기 전에 이름을 바꾸는 작업이 있지만 깨끗한 방법이 있어야한다고 생각했습니다.
업데이트 : 주요 pom.xml 파일 : 여기
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>nz.net.example</groupId>
<artifactId>dept-alfresco</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Quickstart of Alfresco and Share with DB and runner embedded</name>
<description>This All-in-One project allows to manage all the components involved in Alfresco development (Repo, Share, Solr, AMPs) in one project</description>
<packaging>pom</packaging>
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-parent</artifactId>
<version>1.0</version>
</parent>
<!--
| SDK properties have sensible defaults in the SDK parent,
| but you can override the properties below to use another version.
| For more available properties see the alfresco-sdk-parent POM.
-->
<properties>
<alfresco.groupId>org.alfresco</alfresco.groupId>
<alfresco.version>4.2.c</alfresco.version>
<app.log.root.level>WARN</app.log.root.level>
<alfresco.data.location>alf_data_dev</alfresco.data.location>
<alfresco.port>8080</alfresco.port>
<share.port>8080</share.port>
<!-- This controls which properties will be picked in src/test/properties for embedded run -->
<env>local</env>
<!-- Build Information to be injected during Jenkins build process -->
<build.date>Not Built with Jenkins</build.date>
<jenkins.buildNo>Not Built with Jenkins</jenkins.buildNo>
<jenkins.buildURL>Not Built with Jenkins</jenkins.buildURL>
<jenkins.job>Not Built with Jenkins</jenkins.job>
<git.branch>Not Built with Jenkins</git.branch>
<git.commit>Not Built with Jenkins</git.commit>
</properties>
<!-- Here we realize the connection with the Alfresco selected platform (e.g.version and edition) -->
<dependencyManagement>
<dependencies>
<!-- This will import the dependencyManagement for all artifacts in the selected Alfresco plaftorm
(see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies)
NOTE: You still need to define dependencies in your POM, but you can omit version as it's enforced by this dependencyManagement.
NOTE: It defaults to the latest version this SDK pom has been tested with, but alfresco version can/should be overridden in your project's pom
-->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-platform-distribution</artifactId>
<version>${alfresco.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!--
No more repos are needed since they will be inherited by the parent POM.
This is needed to download the alfresco-plaftorm POM.
-->
<repositories>
<repository>
<id>alfresco-artifacts</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
<repository>
<id>alfresco-artifacts-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
</repository>
</repositories>
<modules>
<module>amp</module>
<module>alfresco</module>
<module>solr</module>
<module>share</module>
<module>wcmqs</module>
<module>runner</module>
</modules>
</project>
와는 subpom
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<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>
<artifactId>alfresco</artifactId>
<name>Alfresco Repository and Explorer Client</name>
<packaging>war</packaging>
<description>Alfresco Repository and Explorer Client</description>
<parent>
<groupId>nz.net.example</groupId>
<artifactId>dept-alfresco</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco</artifactId>
<type>war</type>
</dependency>
<!--
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-repository</artifactId>
</dependency>
-->
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<!-- Here is can control the order of overlay of your (WAR, AMP, etc.) dependencies
| NOTE: At least one WAR dependency must be uncompressed first
| NOTE: In order to have a dependency effectively added to the WAR you need to
| explicitly mention it in the overlay section.
| NOTE: First-win resource strategy is used by the WAR plugin
-->
<overlays>
<!-- Current project customizations -->
<overlay />
<!-- The Alfresco WAR -->
<overlay>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco</artifactId>
<type>war</type>
<!-- To allow inclusion of META-INF -->
<excludes />
</overlay>
</overlays>
</configuration>
</plugin>
</plugins>
</build>
</project>
'mvn install'을 실행 한 후'ls' 또는'find./target'의 출력을 붙여 넣기를 원할 수도 있습니다. –
이 경우' xyz.war '을 사용하면 대상 폴더의 이름 만 수정할 수 있지만'mvn install'을 통해서는 설치할 수 없습니다. –
khmarbaise
alfresco pom의 구성에서 stripVersion을 시도했지만 올바르지 않은 요소라고했습니다. 나는 finalName을 시도해 봤지만 여전히 Jenkins에서 올바른 인공물을 얻지 못했습니다. 인공 지능의 버전 번호를 접미사로 사용하지 않도록 추가 할 수있는 시스템 속성이 있습니까 (Jenkins의 maven 옵션에 -D)? – djsumdog