diff options
-rw-r--r-- | UNT.spec | 44 |
1 files changed, 12 insertions, 32 deletions
@@ -9,48 +9,28 @@ Source1: maven-resources-plugin-2.6.jar BuildRequires: maven BuildArch: noarch +%{!?maven_mirror_url: %global maven_mirror_url https://cmc.rnd.huawei.com/mirror/index/cmcmirrors?fromCMC=true} + %description UDF native tool can convert java code to native code, and then compile native code to native binary. %prep %setup -q -n %{name} -mkdir -p %{_builddir}/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.6/ -cp %{SOURCE1} %{_builddir}/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar -cat > %{_builddir}/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom << 'EOF' -<?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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <version>2.6</version> - <packaging>maven-plugin</packaging> - <name>Apache Maven Resources Plugin</name> -</project> -EOF -cat > %{_builddir}/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/maven-metadata-local.xml << 'EOF' -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <versioning> - <latest>2.6</latest> - <release>2.6</release> - <versions> - <version>2.6</version> - </versions> - <lastUpdated>20230101000000</lastUpdated> - </versioning> -</metadata> -EOF + %build -# 使用自定义设置文件运行 Maven 构建 -cat > %{_builddir}/settings.xml << 'EOF' +cat > %{_builddir}/settings.xml << EOF <settings> - <localRepository>%{_builddir}/.m2/repository</localRepository> + <mirrors> + <mirror> + <id>custom-mirror</id> + <mirrorOf>*</mirrorOf> + <name>Custom Maven Repository Mirror</name> + <url>%{maven_mirror_url}</url> + </mirror> + </mirrors> </settings> EOF -# mvn install:install-file -Dfile=%{SOURCE1} -DgroupId=org.apache.maven.plugins -DartifactId=maven-resources-plugin -Dversion=2.6 -Dpackage=jar mvn -s %{_builddir}/settings.xml package -DskipTests %install |