- Home /
Publishing of an artifact Unity in a repository
Hi,
My goal is to publish an APK in a repository like (Nexus). This APK is built in Jenkins with Unity3dBuilder plugin.
To do this, I need to add some plugins in my pom.xml file. Does anyone have an idea about this problem ??
This is my pom.xml file :
<?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>com.company</groupId>
<artifactId>UnityAppTest</artifactId>
<version>1.7-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Application Unity de test</name>
<scm>
...
</scm>
<distributionManagement>
<repository>
...
</repository>
<snapshotRepository>
...
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
...
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- Attach apk to release -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<configuration>
<artifacts>
<artifact>
<file>AngryBirdsAndroid.apk</file>
<type>apk</type>
</artifact>
</artifacts>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Fin -->
<!-- Archivage repo Nexus -SiFAST- -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
<configuration>
<tagBase>...</tagBase>
</configuration>
</plugin>
<plugin>
<groupId>com.github.danielflower.mavenplugins</groupId>
<artifactId>maven-gitlog-plugin</artifactId>
<version>1.4.7</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Fin -->
</plugins>
</build>
</project>
Answer by imen · Feb 09, 2015 at 09:58 AM
Hi :) The solution of this problem is to use build-helper-maven-plugin to attach an additional artifact to the package pom
<!-- Attach apk to release -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${WORKSPACE}\builds\jenkinsTest\jenkinsTest.html</file>
<type>html</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<!-- Fin -->
Your answer
Follow this Question
Related Questions
Problems with loading asset bundles on android 1 Answer
[Unity Android]Game crashes(exit to home screen) just after the "Powered by Unity" splash screen. 3 Answers
Why is my build working on Unity but doesn't work on android? 1 Answer
how to access and modify my existing database made by DB browser for SQLite in unity after build 0 Answers
Dynamic Shadow not building to Nexus 10 0 Answers