Deploying bundles with Maven on publish instance
Hi Guys,
I'm trying to create a script that builds a publish instance in an automatic way, and I'm having problems when I try to deploy two bundles (custom authenticator and custom login module) using maven with start leven 15.
I'm having the same problem with both, so I'll use on as an example:
For what I could found online, in tutorials and discussions, my top level maven configuration profiles section looks like this:
<profiles>
<profile>
<id>installPackage</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<executions>
<execution>
<id>content-package-install</id>
<phase>package</phase>
<goals>
<goal>install</goal>
</goals>
<configuration>
<userId>admin</userId>
<password>admin</password>
<targetURL>http://${crx.host}:${crx.port}/crx/packmgr/service.jsp</targetURL>
<verbose>true</verbose>
<failOnError>true</failOnError>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>autoInstallBundle</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
<executions>
<execution>
<id>install-bundle</id>
<goals>
<goal>install</goal>
</goals>
<configuration>
<slingUrl>${crx.url}/system/console/install</slingUrl>
<user>${crx.user}</user>
<password>${crx.password}</password>
<bundleStartLevel>15</bundleStartLevel>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Case 1) When I run mvn clean install -P installPackage, the bundle gets deployed, but with level 20 (and it has to be 15).
Case 2) When I run mvn -P autoInstallBundle install, I get the following message:
C:\development\CQ5\AEM561\CQ5\test-publish\projects\authentication\content\target\authentication-content-1.0-SNAPSHOT.jar is not an OSGi Bundle, not uploading
What it's happening here is that maven tries to deploy my content project as a bundle, instead of my bundle project.
Case 3) I went further and added the autoInstallBundle profile to my bundle's projects pom (instead of the root one). But when I try to run mvn -P autoInstallBundle install, inside the bundle directory I'm getting the following error message:
[INFO] --- maven-sling-plugin:2.0.6:install (install-package) @ login-bundle ---
[INFO] Installing Bundle com.avatarla.televisa.login-bundle(C:\development\CQ5\AEM561\CQ5\test-publish\projects\login\bundle\target\login-bundle-1.0-SNAPSHOT.jar) to http://localhost:4503/system/console/install via PUT
[ERROR] Installation failed, cause: Method Not Allowed
Do you have any idea of what might be happening and how to solve it?
Thanks in advance,