Enabling Release Management in Bamboo - release

I'm running JIRA and Bamboo which are connected by the application link. In Bamboo, there is a Maven project with the following 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.experiments</groupId>
<artifactId>howto-release</artifactId>
<version>${ci.version}</version>
<packaging>jar</packaging>
<name>howto-release</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<ci.version>2.6-SNAPSHOT</ci.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<scm>
<connection>scm:svn:http://svn.xxx.lan/svn/howto-release/trunk</connection>
<developerConnection>scm:svn:http://svn.xxx.lan/svn/howto-release/trunk</developerConnection>
<url>http://svn.xxx.lan/svn/howto-release/trunk</url>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-8</version>
<configuration>
<tagBase>http://svn.xxx.lan/svn/howto-release/tag</tagBase>
<username>release-user</username>
<password>release-user</password>
</configuration>
</plugin>
</plugins>
</build>
The maven goal definition in Bamboo looks like this:
clean install -Dci.version=${bamboo.custom.brmp.name}
By now, I want to use the incorporated feature "release management" as described here:
http://www.youtube.com/watch?v=OH-Iq4z8Mj8
http://blogs.atlassian.com/2010/09/bamboo_jira_release_management_plugin_part_2/
Unfortunately, it doesn't work as described by the Atlassian guys. There is no "enable release management" checkbox in "Plan configuration / Miscellaneous".
I have also troubles with the Release button in JIRA which currently issues an error message like this: "Bamboo server has not returned any Plans."
Does anybody know how to deal with the automated release management plugin in Bamboo and what I have to do to get the options visible (see "Plan configuration / Miscellaneous")?
I'm running the following versions of JIRA and Bamboo:
JIRA version v5.1.5#784-sha1:6c72993
Bamboo Version 4.4.0 build 3501 - 28 Jan 13.
Your help is appreciated!!
Thank you.
Katarina

Related

Build dependency with a specific profile

I have a web project with a dependency I want to compile on a different profile so it generates some additional files I want on the web project.
To be more specific, a Web project with a Netbeans Application as dependency. The Netbeans project has a deployment profile that created the update center (just a folder with files in it). I want this update center to be added to the war file for deployment.
Is there a way to make the web project build the dependency on this profile so I get the files I need?
Is there other options to make this work?
Update: Example
<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>
<!-- The Basics -->
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<dependencies>
<dependency>
<groupId>project-of-interest</groupId>
<artifactId>project-id</artifactId>
<version>4.0</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>resource2</directory>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</project>
project-of-interest has a deployment profile in which the files I need are generated and somehow resource2 points to the location of those files.
My main issue is making sure the files I need are available.
you can point to specific profile with maven command
mvn clean install -P $profile

Betamax with Spring Boot throws Illegal use of nonvirtual function call

I'm trying to setup a simple test in Groovy with Spock using Betamax:
class BetaMaxSpockTest extends Specification {
#Rule
public Recorder recorder = new Recorder()
#Betamax(tape = "some_tape")
def 'You shall pass'() {
expect:
true
}
}
I'm also using Spring Boot so I have spring-boot-starter-parent as my parent in pom.xml:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.6.RELEASE</version>
</parent>
When I run above test I'm getting this error:
java.lang.VerifyError: (class: co/freeside/betamax/proxy/jetty/BetamaxProxy, method: super$3$getBean signature: (Ljava/lang/Class;)Ljava/lang/Object;) Illegal use of nonvirtual function call
at java.lang.Class.forName(Class.java:264)
at co.freeside.betamax.proxy.jetty.ProxyServer.start(ProxyServer.groovy:47)
at co.freeside.betamax.Recorder.startProxy(Recorder.groovy:198)
at co.freeside.betamax.Recorder.withTape(Recorder.groovy:167)
at co.freeside.betamax.Recorder$1.evaluate(Recorder.groovy:185)
at org.spockframework.runtime.extension.builtin.MethodRuleInterceptor.intercept(MethodRuleInterceptor.java:40)
at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:84)
at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
at org.spockframework.util.ReflectionUtil.invokeMethod
Without Spring Boot on path it works fine. Looks like some versions problem. Anyone had similar issue?
My full 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>com.test</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.6.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
<!--plugins versions-->
<maven.compiler.plugin.version>3.3</maven.compiler.plugin.version>
<!--settings-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!--Spring Boot-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--Spock Testing-->
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<scope>test</scope>
</dependency>
<!--Groovy Testing-->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<scope>test</scope>
</dependency>
<!--Betamax Http Mocks-->
<dependency>
<groupId>co.freeside</groupId>
<artifactId>betamax</artifactId>
<version>1.1.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<--...-->
</pluginManagement>
</build>
</project>
There are a couple things you can do to fix this. The first is that you can make the code in question #CompileStatic (probably the Spec in your case) which often resolves the issue, but this is not always desireable (and does not always work).
The other thing you can do is add -Xverify:none to your java command line options (wherever you would specify them for your environment). This will turn off the verification, which is what is causing the error.
From what I have read about this issue when I originally ran into it, they are planning on turning off verification by default in the next Java version. This generally occurs with Groovy or other libraries that do a lot of bytecode manipulation under the covers (asm is another).
I have found the solution. The problem was in wrong versions of jetty and httpclient. BetaMax requires versions shown below, while Spring's parent pom declares much newer versions.
Adding this two lines to properties in my pom.xml solved the issue:
<jetty.version>7.3.1.v20110307</jetty.version>
<httpclient.version>4.2.1</httpclient.version>
Anyway, thanks for your help!

Karaf custom appender starts with error: java.lang.NoClassDefFoundError: javax/crypto/SecretKey

I'd a custom log4j custom appender, it works in my testing environment like:
C:\Log4jTest>java -cp . Log4jTest
But when configuring it into Karaf, when starting it always throws error:
org.apache.felix.configadmin-1.2.8|[org.osgi.service.log.LogService, org.knopflerfish.service.log.LogService, org.ops4j.pax.logging.PaxLoggingService, org.osgi.service.cm.ManagedService, id=8, bundle=4]: Unexpected problem updating Configuration PID=org.ops4j.pax.logging, factoryPID=null, bundleLocation=mvn:org.ops4j.pax.logging/pax-logging-service/1.6.9
java.lang.NoClassDefFoundError: javax/crypto/SecretKey
at com.microsoft.azure.storage.Credentials.(Credentials.java:63)
at com.microsoft.azure.storage.StorageCredentialsAccountAndKey.(StorageCredentialsAccountAndKey.java:42)
......
My mvn POM.XML is very simple:
[<?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>com.hcit.logger</groupId>
<artifactId>cloud-logger-service</artifactId>
<version>1.0.0</version>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-service</artifactId>
<version>1.6.9</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-storage</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Export-Package>com.hcit.logger</Export-Package>
<Import-Package>!*</Import-Package>
<Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
<_failok>true</_failok>
<Fragment-Host>org.ops4j.pax.logging.pax-logging-service</Fragment-Host>
<Implementation-Version>${project.version}</Implementation-Version>
<Bundle-Version>${project.version}</Bundle-Version>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
]
And snippet of my org.ops4j.pax.logging.cfg:
....
log4j.appender.hafauditCloudLoggerAppender=com.hcit.logger.CloudLoggerAppender
log4j.appender.hafauditCloudLoggerAppender.Threshold=DEBUG
log4j.appender.hafauditCloudLoggerAppender.TableName=LoggerTable
log4j.category.com.gehcit.haf.audit.consumer = DEBUG,hafauditCloudLoggerAppender
......
I checked that my jre.properties did have the javax.crypto:
......
javax.crypto, \
javax.crypto.interfaces, \
javax.crypto.spec, \
......
I'm new to Karaf, and wonder how to resolve it? my JDK is jdk1.7.0_72 and thanks.
Finally I found the tricks, if changing the config.properties by adding those components like this:
org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.,com.sun.,javax.transaction,javax.transaction.,javax.sql.,oracle.,com.microsoft.sqlserver., javax.crypto, javax.crypto., javax.xml., com.fasterxml.*
It works.
of course in POM.xml should add the dependency of fasterxml:
[<dependency>
<groupId>de.matrixweb.smaller</groupId>
<artifactId>ant</artifactId>
<version>0.8.4</version>
</dependency>]

Intellij 13.0.2 Community Edition cannot find step defs using Gherkin plugin

I have a maven project with two modules. I will just mention one of the modules here called app. Using my RunCukesTest class I am able to execute my single scenario and it can see that the first step has been defined and executes it. But IntelliJ's Gherkin plugin thinks my first step is undefined plus there is no code assistance from IntelliJ for me to be able to define a step in my step def class called LoginStepdefs. Why can't the Gherkin plugin find my step defs in class LoginStepdefs?
NB: The login.feature has the gherkin icon next to it and when hovering my mouse pointer over the first step it shows flyover text "Undefined step reference..."
The root pom.xml is:
<?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>jpro</groupId>
<artifactId>jpro</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>app</module>
</modules>
</project>
In the app module the pom.xml is:
<?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">
<parent>
<artifactId>jpro</artifactId>
<groupId>jpro</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>app</artifactId>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
The directory structure I have is:
jpro
app
pom.xml
src
main
test
java
pro
j
runner
RunCukesTest.java
stepdef
LoginStepdefs.java
resources
feature
login.feature
pom.xml
The file login.feature contains:
#SC_LOGIN
Feature: Login with username and password
RQ_LOGIN_1: User can login using a username and password
#SC_LOGIN_1 #RQ_LOGIN_1
Scenario: Valid username and valid password
Given I am not logged in
When I go to the home page
Then I should see the login page
When I enter the username jpro
And I enter the password password
And I click the login button
Then I should see that I am logged in as jpro
I found out the solution. Install the Jetbrain's plugin called "Cucumber for Java". :)
I was trying to use the Gherkin plugin.

Maven ANTLR generating wrong directory

I have the following pom.xml:
<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>db.project</groupId>
<artifactId>engine</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<antlr4.visitor>true</antlr4.visitor>
<antlr4.listener>true</antlr4.listener>
</properties>
<dependencies>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
<version>4.0</version>
<configuration>
<sourceDirectory>src</sourceDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>antlr4</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
Normally, I use ANLTR 4 plugin which is described in this link : https://github.com/jknack/antlr4ide . But I want to use maven now, when I update my grammar in com.db.project directory, parser and lexer are generated in both default package (i.e., src/default package) and src/com/db/project/ twice, whereas I only want my lexer and parser in src/com/db/project/ directory. (including both .g4 file and java files in the same package)
How can I change this via pom.xml?
Simple change 4.0 to 4.2 in your antlr4-maven-plugin's version tag.
Note that the plugin will recursively scan src/main/antlr4 for .g4 grammar files. If your grammar resides in src/main/antlr4/com/company then the package of your generated parser/lexer files will be com.company.
Here's a small template project to get you started, in case you need it:
https://github.com/bkiers/antlr4-template

Resources