我们最近在构建和测试过程中添加了FindBugs,但是当我们使用@SuppressWarning注释时,我们遇到了一些问题。
更有趣的是,代码可以在我们的三台开发人员笔记本电脑上编译,但不能在我们的构建系统上编译,即使代码是相同的,使用的Java编译器是相同的(1.5.0_22 - 32位)。
这里是问题:我们有一个项目,HCSBeans,它依赖于另一个项目,CommonLibrary。CommonLibrary使用@SuppressWarning一次,而HCSBeans没有。CommonLibrary构建在我们的笔记本电脑和构建系统上,但是HCSBeans并不构建在构建系统上。在这一点上,我找不到构建系统和我的笔记本电脑之间的区别。
下面是构建系统的详细Ant输出(注意:我们没有使用Maven):-do-compile:
[mkdir] Created dir: C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeansbuildempty
[javac] comhcsorcuiBindingHandler.java added as comhcsorcuiBindingHandler.class doesn't exist.
[javac] comhcsorcuiJRadioButtonUpdatable.java added as comhcsorcuiJRadioButtonUpdatable.class doesn't exist.
[javac] comhcsorcuiJTextAreaSizeFix.java added as comhcsorcuiJTextAreaSizeFix.class doesn't exist.
[javac] comhcsorcuiORCAssignmentPanel.java added as comhcsorcuiORCAssignmentPanel.class doesn't exist.
[javac] comhcsorcuiORCCheckBox.java added as comhcsorcuiORCCheckBox.class doesn't exist.
[javac] comhcsorcuiORCLabel.java added as comhcsorcuiORCLabel.class doesn't exist.
[javac] comhcsorcuiORCLabelBeanInfo.java added as comhcsorcuiORCLabelBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCPanel.java added as comhcsorcuiORCPanel.class doesn't exist.
[javac] comhcsorcuiORCPanelBeanInfo.java added as comhcsorcuiORCPanelBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCRadioButton.java added as comhcsorcuiORCRadioButton.class doesn't exist.
[javac] comhcsorcuiORCRadioButtonBeanInfo.java added as comhcsorcuiORCRadioButtonBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCRadioButtonGroup.java added as comhcsorcuiORCRadioButtonGroup.class doesn't exist.
[javac] comhcsorcuiORCRadioButtonGroupBeanInfo.java added as comhcsorcuiORCRadioButtonGroupBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCScrollPane.java added as comhcsorcuiORCScrollPane.class doesn't exist.
[javac] comhcsorcuiORCScrollPaneBeanInfo.java added as comhcsorcuiORCScrollPaneBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCSeparator.java added as comhcsorcuiORCSeparator.class doesn't exist.
[javac] comhcsorcuiORCSeparatorBeanInfo.java added as comhcsorcuiORCSeparatorBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCSplitPane.java added as comhcsorcuiORCSplitPane.class doesn't exist.
[javac] comhcsorcuiORCSplitPaneBeanInfo.java added as comhcsorcuiORCSplitPaneBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCTabbedPane.java added as comhcsorcuiORCTabbedPane.class doesn't exist.
[javac] comhcsorcuiORCTabbedPaneBeanInfo.java added as comhcsorcuiORCTabbedPaneBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCTable.java added as comhcsorcuiORCTable.class doesn't exist.
[javac] comhcsorcuiORCTableBeanInfo.java added as comhcsorcuiORCTableBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCTextArea.java added as comhcsorcuiORCTextArea.class doesn't exist.
[javac] comhcsorcuiORCTextAreaBeanInfo.java added as comhcsorcuiORCTextAreaBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCTextField.java added as comhcsorcuiORCTextField.class doesn't exist.
[javac] comhcsorcuiORCTextFieldBeanInfo.java added as comhcsorcuiORCTextFieldBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCTextPane.java added as comhcsorcuiORCTextPane.class doesn't exist.
[javac] comhcsorcuiORCTextPaneBeanInfo.java added as comhcsorcuiORCTextPaneBeanInfo.class doesn't exist.
[javac] comhcsorcuiRoundButtonBorder.java added as comhcsorcuiRoundButtonBorder.class doesn't exist.
[javac] comhcsorcuiTextLabelUI.java added as comhcsorcuiTextLabelUI.class doesn't exist.
[javac] comhcsorcuiTextTransfer.java added as comhcsorcuiTextTransfer.class doesn't exist.
[javac] comhcsorcuiTouchButton.java added as comhcsorcuiTouchButton.class doesn't exist.
[javac] comhcsorcuiTouchButtonUpdatable.java added as comhcsorcuiTouchButtonUpdatable.class doesn't exist.
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiresourcesblack_box.gif skipped - don't know how to handle it
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiresourcesblack_box_disabled.gif skipped - don't know how to handle it
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiresourcesblack_box_x.gif skipped - don't know how to handle it
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiresourcesblack_box_x_disabled.gif skipped - don't know how to handle it
[javac] Compiling 34 source files to C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeansbuildclasses
[javac] Using external javac compiler
[javac] Compilation arguments:
[javac] '-d'
[javac] 'C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeansbuildclasses'
[javac] '-classpath'
[javac] 'C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeansbuildclasses;C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbCommonLibrarydistCommonLibrary.jar;C:Documents and Settingsstephen.hudsonjobsORC Trunkworkspaceorclibswing-layout-1.0.4.jar'
[javac] '-sourcepath'
[javac] 'C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeansbuildempty'
[javac] '-target'
[javac] '1.5'
[javac] '-encoding'
[javac] 'windows-1252'
[javac] '-g'
[javac] '-source'
[javac] '1.5'
[javac]
[javac] The ' characters around the executable and arguments are
[javac] not part of the command.
[javac] Files to be compiled:
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiBindingHandler.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiJRadioButtonUpdatable.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiJTextAreaSizeFix.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCAssignmentPanel.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCCheckBox.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCLabel.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCLabelBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCPanel.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCPanelBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCRadioButton.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCRadioButtonBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCRadioButtonGroup.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCRadioButtonGroupBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCScrollPane.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCScrollPaneBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCSeparator.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCSeparatorBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCSplitPane.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCSplitPaneBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCTabbedPane.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCTabbedPaneBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCTable.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCTableBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCTextArea.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCTextAreaBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCTextField.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCTextFieldBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCTextPane.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiORCTextPaneBeanInfo.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiRoundButtonBorder.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiTextLabelUI.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiTextTransfer.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiTouchButton.java
[javac] C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeanssrccomhcsorcuiTouchButtonUpdatable.java
[javac] An exception has occurred in the compiler (1.5.0_22). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
[javac] com.sun.tools.javac.code.Symbol$CompletionFailure: file eduumdcsfindbugsannotationsSuppressWarnings.class not found
[ant] Exiting C:Documents and Settingsstephen.hudsonjobsORC TrunkworkspaceorcnbHCSBeansbuild.xml.
[antcall] Exiting C:Documents and Settingsstephen.hudsonjobsORC Trunkworkspaceorcnbbuild.xml.
下面是我的笔记本电脑上的详细Ant输出:
-do-compile:
[mkdir] Created dir: C:hcsorcnbHCSBeansbuildempty
[javac] comhcsorcuiBindingHandler.java added as comhcsorcuiBindingHandler.class doesn't exist.
[javac] comhcsorcuiJRadioButtonUpdatable.java added as comhcsorcuiJRadioButtonUpdatable.class doesn't exist.
[javac] comhcsorcuiJTextAreaSizeFix.java added as comhcsorcuiJTextAreaSizeFix.class doesn't exist.
[javac] comhcsorcuiORCAssignmentPanel.java added as comhcsorcuiORCAssignmentPanel.class doesn't exist.
[javac] comhcsorcuiORCCheckBox.java added as comhcsorcuiORCCheckBox.class doesn't exist.
[javac] comhcsorcuiORCLabel.java added as comhcsorcuiORCLabel.class doesn't exist.
[javac] comhcsorcuiORCLabelBeanInfo.java added as comhcsorcuiORCLabelBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCPanel.java added as comhcsorcuiORCPanel.class doesn't exist.
[javac] comhcsorcuiORCPanelBeanInfo.java added as comhcsorcuiORCPanelBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCRadioButton.java added as comhcsorcuiORCRadioButton.class doesn't exist.
[javac] comhcsorcuiORCRadioButtonBeanInfo.java added as comhcsorcuiORCRadioButtonBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCRadioButtonGroup.java added as comhcsorcuiORCRadioButtonGroup.class doesn't exist.
[javac] comhcsorcuiORCRadioButtonGroupBeanInfo.java added as comhcsorcuiORCRadioButtonGroupBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCScrollPane.java added as comhcsorcuiORCScrollPane.class doesn't exist.
[javac] comhcsorcuiORCScrollPaneBeanInfo.java added as comhcsorcuiORCScrollPaneBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCSeparator.java added as comhcsorcuiORCSeparator.class doesn't exist.
[javac] comhcsorcuiORCSeparatorBeanInfo.java added as comhcsorcuiORCSeparatorBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCSplitPane.java added as comhcsorcuiORCSplitPane.class doesn't exist.
[javac] comhcsorcuiORCSplitPaneBeanInfo.java added as comhcsorcuiORCSplitPaneBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCTabbedPane.java added as comhcsorcuiORCTabbedPane.class doesn't exist.
[javac] comhcsorcuiORCTabbedPaneBeanInfo.java added as comhcsorcuiORCTabbedPaneBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCTable.java added as comhcsorcuiORCTable.class doesn't exist.
[javac] comhcsorcuiORCTableBeanInfo.java added as comhcsorcuiORCTableBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCTextArea.java added as comhcsorcuiORCTextArea.class doesn't exist.
[javac] comhcsorcuiORCTextAreaBeanInfo.java added as comhcsorcuiORCTextAreaBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCTextField.java added as comhcsorcuiORCTextField.class doesn't exist.
[javac] comhcsorcuiORCTextFieldBeanInfo.java added as comhcsorcuiORCTextFieldBeanInfo.class doesn't exist.
[javac] comhcsorcuiORCTextPane.java added as comhcsorcuiORCTextPane.class doesn't exist.
[javac] comhcsorcuiORCTextPaneBeanInfo.java added as comhcsorcuiORCTextPaneBeanInfo.class doesn't exist.
[javac] comhcsorcuiRoundButtonBorder.java added as comhcsorcuiRoundButtonBorder.class doesn't exist.
[javac] comhcsorcuiTextLabelUI.java added as comhcsorcuiTextLabelUI.class doesn't exist.
[javac] comhcsorcuiTextTransfer.java added as comhcsorcuiTextTransfer.class doesn't exist.
[javac] comhcsorcuiTouchButton.java added as comhcsorcuiTouchButton.class doesn't exist.
[javac] comhcsorcuiTouchButtonUpdatable.java added as comhcsorcuiTouchButtonUpdatable.class doesn't exist.
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiresourcesblack_box.gif skipped - don't know how to handle it
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiresourcesblack_box_disabled.gif skipped - don't know how to handle it
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiresourcesblack_box_x.gif skipped - don't know how to handle it
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiresourcesblack_box_x_disabled.gif skipped - don't know how to handle it
[javac] Compiling 34 source files to C:hcsorcnbHCSBeansbuildclasses
[javac] Using external javac compiler
[javac] Compilation arguments:
[javac] '-d'
[javac] 'C:hcsorcnbHCSBeansbuildclasses'
[javac] '-classpath'
[javac] 'C:hcsorcnbHCSBeansbuildclasses;C:hcsorcnbCommonLibrarydistCommonLibrary.jar;C:Program Files (x86)NetBeans 7.2platformmodulesextswing-layout-1.0.4.jar'
[javac] '-sourcepath'
[javac] 'C:hcsorcnbHCSBeansbuildempty'
[javac] '-target'
[javac] '1.5'
[javac] '-encoding'
[javac] 'windows-1252'
[javac] '-g'
[javac] '-source'
[javac] '1.5'
[javac]
[javac] The ' characters around the executable and arguments are
[javac] not part of the command.
[javac] Files to be compiled:
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiBindingHandler.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiJRadioButtonUpdatable.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiJTextAreaSizeFix.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCAssignmentPanel.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCCheckBox.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCLabel.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCLabelBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCPanel.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCPanelBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCRadioButton.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCRadioButtonBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCRadioButtonGroup.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCRadioButtonGroupBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCScrollPane.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCScrollPaneBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCSeparator.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCSeparatorBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCSplitPane.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCSplitPaneBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCTabbedPane.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCTabbedPaneBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCTable.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCTableBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCTextArea.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCTextAreaBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCTextField.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCTextFieldBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCTextPane.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiORCTextPaneBeanInfo.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiRoundButtonBorder.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiTextLabelUI.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiTextTransfer.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiTouchButton.java
[javac] C:hcsorcnbHCSBeanssrccomhcsorcuiTouchButtonUpdatable.java
除了编译错误,我看不出有什么不同。
其他值得注意的事项:
- 删除并重新签出两个项目的源代码从SVN。
- Java版本比较。都是32位Java 1.5.0_22。我知道这是旧的,但我们有客户坚持要它。 在CommonLibrary中只有一个@SuppressWarning的引用,而在HCSBeans中没有。
- 我们在构建CommonLibrary时使用annotations.jar和jsr305.jar,但是它们没有打包在一起,也没有被HCSBeans引用。它们在构建之后不应该是必需的。
- 我们的笔记本电脑是64位的,而构建系统是32位的,但是两个Java安装都是32位的。
- 所有电脑都是MS Windows。
我将构建服务器切换到用Java 1.6编译HCSBean和代码编译(在删除未使用的swingutility 2导入后),但如果我将其切换回Java 1.5,它仍然失败,并出现相同的错误。我开始怀疑Java 1.5编译器有问题。
更新2
一个同事发现了真正的区别。不确定为什么会发生这种情况,但这是结果构建之间的区别。在我们的笔记本电脑上,CommonLibrary.jar MANIFEST。MF文件包含这一行:
Class-Path: lib/annotations.jar lib/jsr305.jar
这意味着在构建HCSBeans项目时,它会找到所需的annotation .jar文件。但是,当我们在构建服务器上构建时,不会出现这个Class-Path行。不知道为什么,但这是下一步的调查。
我们找到了问题所在。我们安装了NetBeans的笔记本电脑(即使我们没有直接从NetBeans构建)正在使用copylib来构建jar文件,该文件将所需的行添加到Manifest中。MF文件:
Class-Path: lib/annotations.jar lib/jsr305.jar
但是,我们的构建服务器,没有安装NetBeans,使用j2seproject1:jar来构建jar文件。
解决方案是在构建服务器(对于感兴趣的人来说是Hudson)上构建时将此添加到-D Javac属性中:
libs.CopyLibs.classpath=C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\lib\netbeans\org-netbeans-modules-java-j2seproject-copylibstask.jar
现在我们的笔记本电脑和构建服务器都在使用copylib,它们都可以编译。
呵!真是一团乱麻。
感谢一路上给我指点的人(@Peter-Eliot &@Disco3)。
看起来库正在使用SuppressWarning的FindBugs版本,而不是java.lang
版本。@SuppressWarning
到@java.lang.SuppressWarning
和/或删除SuppressWarning的FindBugs版本的导入,看看是否修复它?
还可以尝试在hudson查看的类路径中添加FindBugs作为库。看起来在您的开发人员机器上,您正在使用NetBeans构建,如果NetBeans将FindBugs偷偷放入ant使用的类路径