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?
Community moderators have prevented the ability to post new answers.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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" />
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.