How to access a plugin in a maven child module from the parent module - maven

I have a maven multi-module setup, which includes the fabric8 plugin in a profile defined in a child module to build a Docker image if the profile is active, see below
Root 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>
<groupId>com.mycompany</groupId>
<artifactId>root</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>control</name>
<packaging>pom</packaging>
<modules>
<module>parent</module>
<module>docker</module>
<module>...</module>
<module>...</module>
<module>...</module>
</modules>
</project>
Child 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>docker</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<profiles>
<profile>
<id>Docker</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.34.1</version>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
<version>${aws.version}</version>
</dependency>
</dependencies>
<configuration>
<registry>${aws.ecr.registry}</registry>
<images>
<image>
<name>${aws.ecr.registry}/${aws.ecr.repository}:${project.artifactId}-${project.version}</name>
<build>
<contextDir>${project.build.directory}/docker.tmp/</contextDir>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>docker-build</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>docker-push</id>
<phase>install</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Runing a normal build, i.e. mvn clean install -PDocker completes successfully, but if I call one of the docker goals from the parent module directly, e.g. mvn -PDocker docker:help it fails with this error
No plugin found for prefix 'docker' in the current project and in the plugin groups
Running the same command from the docker directory completes successfully.
What changes are needed so the command completes successfully in the root directory?

Related

maven Return code is: 409, ReasonPhrase: Conflict

I have problem to deploy my multi-module python project with following structure
parent pom.xml # common pom for others project
project/
pom.xml # project pom
common_features/
sub-project-1/pom.xml # sub project 1 pom
sub-project-2/pom.xml # sub project 2 pom
For deployment I use maven
Settings.xml
General maven setting use for build
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- others options -->
<servers>
<server>
<id>artifacts-SNAPSHOTS</id>
<username>user</username>
<password>password</password>
</server>
</servers>
<!-- others options -->
</settings>
parent pom.xml
In this case we have the same URL for SNAPSHOT and RELEASE repository
<!-- others options -->
<groupId>com.project.common.group.id</groupId>
<artifactId>project-pom</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>
<!-- others options -->
<distributionManagement>
<repository>
<id>artifacts-RELEASES</id>
<url>${dist.repository.releases}</url>
</repository>
<snapshotRepository>
<id>artifacts-SNAPSHOTS</id>
<url>${dist.repository.snapshots}</url>
</snapshotRepository>
</distributionManagement>
<!-- others sections-->
<properties>
<dist.repository.releases>${artifacts.repository.url}</dist.repository.releases>
<dist.repository.snapshots>${artifacts.repository.url}</dist.repository.snapshots>
<artifacts.repository.url>https://domain/artifactory/mvn-repo-dev</artifacts.repository.url>
</properties>
project pom.xml
There you can see that project consists two modules
sub-project-1
sub-project-2
Parent is general parent.
Also I sue maven assembly plugin in order to deploy project into artifactory
<!-- anothers options -->
<parent>
<groupId>com.project.common.group.id</groupId>
<artifactId>project-pom</artifactId>
<version>0.0.1</version>
</parent>
<groupId>com.project.group.id</groupId>
<artifactId>project-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>common_features/sub-project-1</module>
<module>common_features/sub-project-2</module>
</modules>
build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>deploy/artifact-description.xml</descriptor>
</descriptors>
<tarLongFileMode>posix</tarLongFileMode>
</configuration>
<executions>
<execution>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>2.6.1</version>
<inherited>false</inherited>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>publish</goal>
</goals>
<configuration>
<publisher>
<contextUrl>https://domain/artifactory</contextUrl>
<repoKey>mvn-repo-dev</repoKey>
<snapshotRepoKey>mvn-repo-dev</snapshotRepoKey>
<publishArtifacts>true</publishArtifacts>
<publishBuildInfo>true</publishBuildInfo>
<username>deployUser</username>
<password>deployPwd</password>
</publisher>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
artifact-description.xml
I want to deploy only some section therefore I define the following deployment file. With this I ensure that into package will be deploy only common features and project specific scripts/codes
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly- plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>${distributionId}</id>
<formats>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<outputDirectory>project/${subProjectName}/</outputDirectory>
<directory>${basedir}/..</directory>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
<includes>
<include>/*.*</include>
<include>/sub-${subProjectName}/*</include>
</includes>
<excludes>
<exclude>**/*.pyc</exclude>
<exclude>**/*.xls</exclude>
<exclude>**/*.xlsx</exclude>
<exclude>**/pom.xml</exclude>
<exclude>**/target</exclude>
<exclude>**/deploy</exclude>
<exclude>**/.venv</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>
sub-project-1 pom.xml
This is only simple pom without others plugins and build options
<parent>
<groupId>com.project.group.id</groupId>
<artifactId>project-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<packaging>pom</packaging>
<groupId>com.project.group.id</groupId>
<artifactId>sub-project-1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<subProjectName>project-1</subProjectName>
</properties>
sub-project-2 pom.xml
The same pom.xml as for sub-project-1
<parent>
<groupId>com.project.group.id</groupId>
<artifactId>project-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<packaging>pom</packaging>
<groupId>com.project.group.id</groupId>
<artifactId>sub-project-2</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<subProjectName>project-2</subProjectName>
</properties>
Now I want to build and upload only sub-project-1 it into artifactory and therefore I will use the following maven command:
mvn -e -B -U -X clean deploy --projects :sub-project-1 -DskipIntegrationTests=false -DskipCoverageReport=false
But then following error occur:
Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: https://domain/artifactory/mvn-repo-dev/com/project/group/id/project/project-1/1.0.0-SNAPSHOT/sub-project-1-1.0.0-20190723.081454-1.pom. Return code is: 409, ReasonPhrase: Conflict.
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:627)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:541)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:523)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:517)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:497)
at org.eclipse.aether.transport.wagon.WagonTransporter$PutTaskRunner.run(WagonTransporter.java:644)
at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
at org.eclipse.aether.transport.wagon.WagonTransporter.put(WagonTransporter.java:410)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PutTaskRunner.runTask(BasicRepositoryConnector.java:510)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
... 32 more
Now I am not sure what is wrong and I spend a lot of hours of investigation this issue but nothing found. Please do you have some suggestions what is wrong here? Thanks a lot
I found where is the problem. Within parent pom.xml there was the following plugin which change artifactId. I do not know why I got error 409 but finally this was a reason:
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<phase>pre-clean</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
project.getModel().setArtifactId(project.properties["someProperty"].replaceAll('_',
'-'))
project.getArtifact().setArtifactId(project.properties["someProperty"].replaceAll('_',
'-'))
</source>
</configuration>
</execution>
</executions>
</plugin>

Spring boot maven plugin not packaging java classes in Openshift environment

I have a multi-module maven project whose one of these modules uses Spring Boot.
When I package my jar in my PC it works fine and all java classes are included in the jar, but when I do this in an Openshift environment, only the web resources are included, not the java classes.
I have an Openshift DIY cartridge in which, using action hooks I setup the environment, package my jar and run it.
This procedure worked fine until I made some recent changes, which were to divide my maven project into modules.
parent 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>XXXX</groupId>
<artifactId>XXXX</artifactId>
<version>XXXX</version>
<packaging>pom</packaging>
<modules>
<module>data</module>
<module>web</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven.compiler.plugin.version>3.5</maven.compiler.plugin.version>
<maven.jar.plugin.version>3.0.2</maven.jar.plugin.version>
<maven.clean.plugin.version>2.5</maven.clean.plugin.version>
<maven.spring-boot-maven-plugin.version>1.3.3.RELEASE</maven.spring-boot-maven-plugin.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven.clean.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${maven.spring-boot-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
...
</dependencies>
</dependencyManagement>
<dependencies>
....
</dependencies>
web module 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>XXXX</groupId>
<artifactId>XXXX</artifactId>
<version>1.2.3</version>
</parent>
<artifactId>XXXX</artifactId>
<packaging>jar</packaging>
<properties>
...
</properties>
<build>
<finalName>${project.name}-${project.version}</finalName>
<resources>
<resource>
<directory>${project.resources.path}</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>deployments</directory>
<includes>
<include>*.jar</include>
<followSymlinks>false</followSymlinks>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>XXXX</mainClass>
<finalName>XXXX</finalName>
<outputDirectory>../deployments</outputDirectory>
<excludeGroupIds>org.seleniumhq.selenium,org.projectlombok</excludeGroupIds>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
....
</dependencies>
data module 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>XXXX</groupId>
<artifactId>XXXX</artifactId>
<version>1.2.3</version>
</parent>
<artifactId>XXXX</artifactId>
<packaging>jar</packaging>
<properties>
....
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencies>
....
</dependencies>
Maven command I use to package the jar (executed in Openshift cartridge)
${OPENSHIFT_DATA_DIR}${MVN_LINK}/bin/mvn clean install -s
.openshift/action_hooks/settings.xml -DskipTests=true -P prod
mvn -v command in my Openshift box
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11- 10T11:41:47-05:00)
Maven home: /var/lib/openshift/5713d8630c1e66bfc5000085/app- root/data/maven
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /var/lib/openshift/5713d8630c1e66bfc5000085/app- root/data/jdk1.8.0_101/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-573.26.1.el6.x86_64", arch: "i386", family: "unix"
The resulting jar contains all the libs, .properties files, web resources etc. but no sign of the java classes...
What am I missing? why are not the java classes being packaged too?
Many thanks
CASE CLOSED
I found the issue. I gitignored the src folder of the web module by mistake, therefore nothing was being committed to the git repository of the Openshift cartridge, hence it wasn't packaging any java files in the jar, because there were none! Shame on me! ;-)

Artifact has not been packaged yet - maven-dependency-plugin

When I build a multi module maven project(using mvn clean compile) where one dependency(part of the build reactor) is copied into another using dependency:copy, then maven complains with the below error.
Artifact has not been packaged yet. When used on reactor artifact, copy should be executed after packaging: see MDEP-187 is thrown
This is perfectly fine, Maven can't copy the dependent jar because it has not been packaged yet and the dependency has to be resolved from the local project and not from the repository.
Lets say project A is being copied into project B using the dependency:copy goal.
Now if I import the projects into eclipse,with the lifecycle mapping set in such a way that the maven-jar-plugin is executed on project A(which means that A is packaged), still project B complains with the same error. How can I get rid of this.I can't ignore dependency:copy in the m2e lifecycle as it's a crucial phase in the build.
ProjectA's pom file :
<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>
<artifactId>projecta</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>com.coderplus.tests</groupId>
<artifactId>projectparent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<versionRange>[2.4,)</versionRange>
<goals>
<goal>jar</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Project B's pom file
<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>
<artifactId>projectb</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>com.coderplus.tests</groupId>
<artifactId>projectparent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy-plugins</id>
<phase>compile</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>projecta</artifactId>
<version>${project.version}</version>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/classes/jars</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[2.8,)</versionRange>
<goals>
<goal>copy-dependecies</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
and the Parent pom wrapping these 2 modules
<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>com.coderplus.tests</groupId>
<artifactId>projectparent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>projecta</module>
<module>projectb</module>
</modules>
</project>
I need a ProjectB's jar to contain ProjectA's jar in the jars directory(This is required by a custom class-loader part of a home-grown framework)
With m2eclipse, the artifactItems or dependencies will be resolved to the outputDirectory of the corresponding workspace project if the Resolve dependencies from workspace Projects setting is turned on. This is the root cause for the error in my question.
I ended up forking the existing m2e configurator for this plugin so that it can fetch these dependencies/artifactItems from the respository instead of picking it from the workspace project's outputDirectories .
Though this works with few tests which I had done, it is pretty much a work in progress and in case someone wants to help or contribute, the GitHub URL is
https://github.com/coderplus/m2e-maven-dependency-plugin

Sonar with multi-module maven project and profiles

I have a main project pom.xml which has one module not bound to any profile (module A) and one module bound to profile rest (module module.REST). In jenkins profile, there is a build configuration with a cobertura and sonar plugin.
When Jenkins executes the sonar build, the maven runner only analyses modules which are not bound to profiles and the project module itself. Is there any other way to tell sonar to analyze all modules without specifying those modules again in the profile where the plugin itself is located (in my case this is jenkins profile)? I think cobertura plugin does perform code coverage on ALL modules.
Example:
<?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>group</groupId>
<artifactId>project</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>A</module>
</modules>
<profiles>
<profile>
<id>rest</id>
<modules>
<module>module.REST</module>
</modules>
</profile>
<profile>
<id>jenkins</id>
<activation>
<property>
<name>BUILD_NUMBER</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<aggregate>true</aggregate>
<formats>
<format>xml</format>
</formats>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>cobertura</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
</plugins>
</build>
<modules>
<module>module.REST</module>
</modules>
</profile>
</profiles>
</project>

when installing artifact *zip file doesn't appear in local repo

I have project with some configuration files and after run maven install I got *.zip archive in target directory. However in my local repo I have only pom file. I auusme it's because of <packaging>pom</packaging> drfined in pom.xml. How can I get *.zip file in local repo anyway?
Here is the pom
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>
<parent>
<groupId>com.mycomp.name</groupId>
<artifactId>saas-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../saas-parent/pom.xml</relativePath>
</parent>
<!-- TEST -->
<artifactId>htdocs</artifactId>
<name>htdocs</name>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assembly</id>
<goals><goal>single</goal></goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>${project.basedir}/src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
</project>

Resources