Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Error while compiling the JIRA 4.4.4 source code

J Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2012

Note: This appears similar to but not the same as https://answers.atlassian.com/questions/23081/error-while-compiling-the-jira-4-4-3-source-code.

I'm following these instructions

https://developer.atlassian.com/display/DOCS/Using+the+Atlassian+Plugin+SDK+with+a+Source+Code+License to compile the 4.4.4 source code.

I've fixed proxy issues and various missing file errors and now it trundles on until it tries to build the Bamboo plugin where I'm seeing a new error that is not accompanied by a missing file error. I'm new to Maven and not familiar with how to track down and fix this sort of error. This is the end of the log:

[INFO] Manifest validated
[INFO] [amps:jar]
[INFO] [jar:jar]
[INFO] Building jar: D:\work\In-house\JIRA\jira-source\atlassian-jira-4.4.4-source\jira-bamboo-plugin\target\jira-bamboo-plugin-4.3.2.jar
[INFO] [amps:generate-obr-artifact]
[INFO] [bundle:install-file {execution: virtual-execution}]
[INFO] Parsing file:/D:/work/In-house/JIRA/jira-source/atlassian-jira-4.4.4-source/jira-bamboo-plugin/target/obr/obr.xml
[INFO] Installing jira-bamboo-plugin-4.3.2.jar
[INFO] Writing OBR metadata
[INFO] Building jar: D:\work\In-house\JIRA\jira-source\atlassian-jira-4.4.4-source\jira-bamboo-plugin\target\jira-bamboo-plugin-4.3.2.obr
[INFO] [amps:test-jar]
[INFO] Preparing source:jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
[INFO] No goals needed for project - skipping
[INFO] [source:jar {execution: attach-sources}]
[INFO] Building jar: D:\work\In-house\JIRA\jira-source\atlassian-jira-4.4.4-source\jira-bamboo-plugin\target\jira-bamboo-plugin-4.3.2-sources.jar
[INFO] [antrun:run {execution: generate-integration-test-config}]
[INFO] Executing tasks
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: taskdef class org.apache.tools.ant.taskdefs.optional.PropertyFile cannot be found

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28 minutes 6 seconds
[INFO] Finished at: Mon Jan 30 15:20:35 GMT 2012
[INFO] Final Memory: 477M/494M
[INFO] ------------------------------------------------------------------------

I've found the offending class in my repository under \org\apache\ant\ant-nodeps\1.8.1\ant-nodeps-1.8.1.jar - what do I need to do to tell Maven where it is or to copy it to wherever it is that Maven's looking for it?

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
J Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2012

Thanks to James for his help offline. Here's how I eventually got it working:

1) Edit atlassian-jira-4.4.4-source\jira-bamboo-plugin\pom.xml: add

<version>1.7</version>

to the maven-antrun-plugin as per James' answer;

replace

<taskdef name="propertyfile" classname="org.apache.tools.ant.taskdefs.optional.PropertyFile" classpathref="maven.plugin.classpath" />

with

<taskdef name="propertyfile" classname="org.apache.tools.ant.taskdefs.optional.PropertyFile" classpath="${settings.localRepository}/org/apache/ant/ant/1.8.2/ant-1.8.2.jar" />

and replace

                    <dependency>
                        <groupId>ant</groupId>
                        <artifactId>ant-nodeps</artifactId>
                        <version>1.6.5</version>
                    </dependency>
                    <dependency>
                        <groupId>ant</groupId>
                        <artifactId>ant-optional</artifactId>
                        <version>1.5.2</version>
                    </dependency>

with

                    <dependency>
                        <groupId>org.apache.ant</groupId>
                        <artifactId>ant</artifactId>
                        <version>1.8.2</version>
                    </dependency>

2) You'll get another build failure because it can't download FLEX. So get the swc file from one of the zips in http://code.google.com/p/fxspy/downloads/list and install it using

mvn install:install-file -DgroupId=com.flexspy.flex3 -DartifactId=flexspy -Dversion=1.3 -Dpackaging=swc -Dfile=/path/to/file

3) I got permgen memory errors - the recommended MAVEN_OPTS=-Xmx512m wasn't enough so I used

MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=512m

3 votes
William Crighton _CCC_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 10, 2012

This was *EXTREMELY* handy for me tonight...doing emergency debugging on the workflow manager trying to determine why I can no longer create issues via the API with a cross system migrator. Needed to add some additional debug lines into the JIRA source to help uncover the problem.

Thank you so much!

-wc

William Crighton

2 votes
tier-0 grump
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 1, 2012

So, having set up a clean environment and just run this I can cerify that it is indeed broken, and it is due to the bug I referenced above, you can see more information about this bug here :

http://docs.codehaus.org/display/MAVENUSER/Antrun+Plugin

The solution is to make sure all uses of the antrun plugin use the same dependencies apparently, but so far I've had little joy in getting it to work. Watch this space though, as i will find a fix...

tier-0 grump
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 2, 2012

So I've raised a bug - https://jira.atlassian.com/browse/JRA-27024 complete with workarounds. The simplest workaround is to simply change the classpath to point to an ant.jar (but you must use version 1.7 of the plugin to do this). So open up <source folder>/jira-bamboo-plugin.xmla and find the antrun plugin and edit it to reflect something like below:

artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
     <executions>
          <execution>
               <id>generate-integration-test-config</id>
                ...
                            <tasks>
                                 ...
                                <touch file="${project.build.directory}/test-classes/localtest.properties" mkdirs="true" />
                                <taskdef name="propertyfile" classname="org.apache.tools.ant.taskdefs.optional.PropertyFile" classpath="/tmp/lib/ant-1.8.2.jar" />

2 votes
tier-0 grump
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 30, 2012

There is a bug with the maven 2 that affects antrun - see http://jira.codehaus.org/browse/MANTRUN-51 - we tend to always use mqven 2.1 to build JIRA, you can easily see your version by issuing mvn -version - this is the version I use

Apache Maven 2.1.0 (r755702; 2009-03-19 06:10:27+1100)

and you can get it from http://archive.apache.org/dist/maven/binaries/apache-maven-2.1.0-bin.zip

If that's not the problem, then I'm a little stumped - try running with the -e switch to see if you get more informative error messages

J Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 30, 2012

Here's what I get:

J:\>%ATLAS_MVN_HOME%\mvn -version
Apache Maven 2.1.0 (r755702; 2009-03-18 19:10:27+0000)
Java version: 1.6.0_20
Java home: C:\Jira3envt\Java\jdk1.6.0_20\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

I'm just using what's bundled with the latest SDK, as I said before I don't know Maven. I'm not trying to do anything clever, I'm just following the instructions to set up the plugin development environment but I'm finding it really difficult so I appreciate any help you can give.

J Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 30, 2012

Re-running with -e just adds the BuildException trace to the output so nothing I don't already know, ie java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.optional.PropertyFile

What I don't know is how to tell it where the missing class is in the repository.

All I'm doing is trying to follow the Plugin SDK installation instructions, it shouldn't be so hard?

tier-0 grump
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 31, 2012

You're right - it shouldn't be that hard - I'm going to set up a clean environment today and build to see if I can replicate this.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events