Apache Derby Eclipse 插件去哪儿了?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11400225/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where did the Apache Derby Eclipse plug-in go?
提问by Trainbird
Edit: According to the Derby communitythe Eclipse plug-in won't be maintained nor built automatically along the Derby project.
编辑:根据德比社区的说法,Eclipse 插件不会随着德比项目自动维护或构建。
But is there anybody still using this plug-in? Because if so, is there a place he/she publishes the actual builds - which (hopefully) would run under Eclipse Juno?
但是还有人在用这个插件吗?因为如果是这样,他/她是否有发布实际构建的地方——(希望)可以在 Eclipse Juno 下运行?
Or, if this is a real dead end, what are the alternatives?
或者,如果这是一个真正的死胡同,有什么选择?
The original problem
原来的问题
Using
使用
- jdk1.7.0_03
- Eclipse IDE for Java EE Developers (Win32) version Juno (build from 2012/06/14)
- derby-core-plugin 10.8.2 and -ui-plugin 1.1.3 (as there is no eclipse plugin for the latest version 10.9.1.0)
- jdk1.7.0_03
- Eclipse IDE for Java EE Developers (Win32) 版本 Juno(从 2012/06/14 开始构建)
- derby-core-plugin 10.8.2 和 -ui-plugin 1.1.3(因为最新版本 10.9.1.0 没有 eclipse 插件)
Problem
When trying to add a new derby nature (right-click on the java project -> "Apache Derby" -> "Add Apache Derby nature") I only get the following message:
问题
尝试添加新的 derby 性质时(右键单击 java 项目 ->“Apache Derby”->“添加 Apache Derby 性质”),我只收到以下消息:
Apache Derby Ui Plug-in
Error adding Derby jars to the project:
org.eclipse.ui.internal.WorkbenchWindow cannot be cast to
org.eclipse.jface.window.ApplicationWindow
Any ideas?
有任何想法吗?
回答by Richard K. Campion
Apache Derby db-derby-10.9.1.0-src / Eclipse 4.2.1 (Juno) / Java 7
Apache Derby db-derby-10.9.1.0-src / Eclipse 4.2.1 (Juno) / Java 7
Some kind of fix. Needs more research but this will work.
某种修复。需要更多的研究,但这会奏效。
References:
db-derby-10.9.1.0-src/BUILDING.html
db-derby-10.8.1.2-src/plugins/eclipse/Readme.txt
参考资料:
db-derby-10.9.1.0-src/BUILDING.html
db-derby-10.8.1.2-src/plugins/eclipse/Readme.txt
Download the Apache Derby source zip.
Extract the zip.
Change to the source directory.
db-derby-10.9.1.0-src
下载 Apache Derby 源 zip。
解压缩。
切换到源目录。
db-derby-10.9.1.0-src
Perform the following ant targets.
ant -quiet clobber
ant -quiet buildsource
ant -quiet buildjars
执行以下蚂蚁目标。
ant -quiet clobber
ant -quiet buildsource
ant -quiet buildjars
Build the core plugin.
ant plugin
构建核心插件。
蚂蚁插件
You should now have a derby_core_plugin_10.9.1.zip file in the db-derby-10.9.1.0-src/jars/sane directory.
您现在应该在 db-derby-10.9.1.0-src/jars/sane 目录中有一个 derby_core_plugin_10.9.1.zip 文件。
Note: Your Eclipse IDE should not be running. Extract the derby core plugin created by the ant plugin task above and copy the contents to your Eclipse plugins directory.
注意:您的 Eclipse IDE 不应运行。提取由上面的 ant 插件任务创建的 derby 核心插件,并将内容复制到您的 Eclipse 插件目录。
Run Eclipse.
运行 Eclipse。
Import the org.apache.derby.ui from the source tree.
(Import > General > Existing Projects into Workspace)
从源代码树中导入 org.apache.derby.ui。
(导入 > 常规 > 现有项目到工作区)
Open the plugin.xml file
打开 plugin.xml 文件
On the Overview tab, bump up the version number to let's say 1.1.4.
在概览选项卡上,将版本号提高到 1.1.4。
Save the file.
保存文件。
The bug(s) are in ...
1.)package org.apache.derby.ui.popup.actions.AddDerbyNature.java
2.)package org.apache.derby.ui.popup.actions.RemoveDerbyNature.java
错误在 ...
1.) 包 org.apache.derby.ui.popup.actions.AddDerbyNature.java
2.) 包 org.apache.derby.ui.popup.actions.RemoveDerbyNature.java
Where the .setStatus method are called in these two units.
在这两个单元中调用 .setStatus 方法的地方。
Note: ( from the javadoc of ApplicationWindow )
注意:(来自 ApplicationWindow 的 javadoc )
void org.eclipse.jface.window.ApplicationWindow.setStatus(String message)
Sets or clears the message displayed in this window's status line (if it has >one). This method has no effect if the window does not have a status line.
Parameters:
message the status message, or null to clear it
void org.eclipse.jface.window.ApplicationWindow.setStatus(String message)
设置或清除显示在此窗口状态行中的消息(如果有 >one)。如果窗口没有状态行,则此方法无效。
参数:
message 状态消息,或 null 清除它
So let's assume the IDE doesn't have a status line, so this call has no effect according to the Java doc.
因此,让我们假设 IDE 没有状态行,因此根据 Java 文档,此调用无效。
Commenting out these method calls from:
AddDerbyNature.java
//((ApplicationWindow) window).setStatus(Messages.ADDING_NATURE);
//((ApplicationWindow) window).setStatus(Messages.DERBY_NATURE_ADDED);
RemoveDerbyNature.java
//((ApplicationWindow)window).setStatus(Messages.REMOVING_NATURE);
//((ApplicationWindow)window).setStatus(Messages.DERBY_NATURE_REMOVED);
Test(s):
Run As Eclipse Application.
测试:
作为 Eclipse 应用程序运行。
Create a project. Maybe call it “org.apache.derby.ui.test”.
创建一个项目。也许称之为“org.apache.derby.ui.test”。
Right Click on project / Select Add Apache Derby nature
No error.
右键单击项目/选择添加 Apache Derby 性质
没有错误。
Right Click on project / Select Remove Apache Derby nature
No error.
右键单击项目/选择删除 Apache Derby 性质
没有错误。
Add the nature again to test the other menu items.
Right Click on project / Select Add Apache Derby nature
再次添加自然来测试其他菜单项。
右键单击项目/选择添加 Apache Derby 性质
Right Click on project / Select Start Derby Network Server
No error, server was started.
右键单击项目/选择启动 Derby 网络服务器
没有错误,服务器已启动。
From the console log ... Sun Jan 27 17:51:29 EST 2013 : Security manager installed using the Basic server security policy. Sun Jan 27 17:51:29 EST 2013 : Apache Derby Network Server - 10.9.1.0 - (Unversioned directory) started and ready to accept connections on port 1527
从控制台日志... Sun Jan 27 17:51:29 EST 2013:使用基本服务器安全策略安装的安全管理器。Sun Jan 27 17:51:29 EST 2013:Apache Derby 网络服务器 - 10.9.1.0 -(未版本控制的目录)已启动并准备接受端口 1527 上的连接
Note: Not sure what the Unversioned directory message means
注意:不确定 Unversioned 目录消息是什么意思
Right Click on project / Select Stop Derby Network Server
No error, server was stopped.
Sun Jan 27 17:53:32 EST 2013 : Apache Derby Network Server - 10.9.1.0 - (Unversioned directory) shutdown
右键单击项目/选择停止 Derby 网络服务器
没有错误,服务器已停止。
Sun Jan 27 17:53:32 EST 2013:Apache Derby 网络服务器 - 10.9.1.0 -(未版本控制的目录)关闭
Start the server back up …
Right Click on project / Select Start Derby Network Server
启动服务器备份……
右键单击项目/选择启动 Derby 网络服务器
create a sql folder.
create a test.sql file
创建一个sql文件夹。
创建一个 test.sql 文件
my test sql file.
我的测试 sql 文件。
connect 'jdbc:derby://localhost:1527/TESTDB;create=true;user=test;password=test;';
-- drop User Indexes - ignore error if first time creating
drop index UserNameIdx1;
-- drop the table if it exists - ignore error if first time creating
drop table TEST_USER;
-- create the table
create table TEST_USER (
ID integer generated by default as identity,
USER_NAME varchar(255) not null,
FIRST_NAME varchar(255),
LAST_NAME varchar(255),
PASSWORD varchar(255),
ENABLED integer,
CREATED_STAMP timestamp,
CREATED_TX_STAMP timestamp,
LAST_UPDATED_STAMP timestamp,
LAST_UPDATED_TX_STAMP timestamp,
constraint TEST_USER_PK primary key (ID)
);
-- insert some data -- oops --- will mess with the ID generator, see the alter table restart line below.
insert into TEST_USER values(0, 'admin','admin','admin','admin',1,'2013-01-18 12:00:00.000','2013-01-18 12:00:00.000','2013-01-18 12:00:00.000','2013-01-18 12:00:00.000');
-- make the USER_NAME unique
create unique index UserNameIdx1 on TEST_USER(USER_NAME);
-- reset the generator
alter table TEST_USER alter column ID restart with 1;
Right click on file > Apache Derby > Run SQL Script using 'ij'
右键单击文件 > Apache Derby > 使用“ij”运行 SQL 脚本
Refesh the projects workspace, now there should be a TESTDB folder.
刷新项目工作区,现在应该有一个 TESTDB 文件夹。
Database was created. Ok.
数据库已创建。好的。
Create a zip.
创建一个拉链。
Right click on project > Export
右键单击项目>导出
Click on Plug-in Development > Deplyable plug-ins and fragments.
Destination Tab
Archive file
/derby_ui_plugin_1.1.4-fix.zip
Options Tab
Unselect Package plugins as individual JAR archives
单击插件开发 > Deplyable 插件和片段。
目标选项卡
存档文件
/derby_ui_plugin_1.1.4-fix.zip
选项选项卡
取消选择包插件作为单独的 JAR 存档
Click finish.
单击完成。
Close / Exit the test instance.
Exit Eclipse.
关闭/退出测试实例。
退出日食。
Extract the zip that you just created from above.
从上面提取您刚刚创建的 zip。
Copy it's contents to the plugins directory to your Eclipse (Juno) plugins directory.
将它的内容复制到插件目录到您的 Eclipse (Juno) 插件目录。
Restart Eclipse. Create a new project.
重新启动 Eclipse。创建一个新项目。
You should be able to install an Apache Derby (10.9.1) nature onto your projects.
您应该能够将 Apache Derby (10.9.1) 特性安装到您的项目中。
Note: if you built this with Java 7, don't expect it to work for any lesser JVM version.
注意:如果你用 Java 7 构建它,不要指望它适用于任何较低的 JVM 版本。
回答by Bryan Pendleton
The Derby UI plugin for Eclipse has not been maintained for several years, I believe, as none of the regular Derby committers uses that plugin, and there have not been any volunteers from the community to maintain it. So I think it only works with older versions of Eclipse.
我相信,Eclipse 的 Derby UI 插件已经好几年没有维护了,因为没有一个常规的 Derby 提交者使用该插件,而且社区中也没有任何志愿者来维护它。所以我认为它只适用于旧版本的 Eclipse。
I suspect that it is not very much work to bring it up to date to make it work with current Eclipse. If you are interested in that functionality, I'm sure the Derby community would love to hear from you!
我怀疑更新它以使其与当前的 Eclipse 一起工作并不是很多工作。如果您对该功能感兴趣,我相信 Derby 社区很乐意收到您的来信!
另请参阅:既然他们已停止为 Eclipse 开发 derby 插件,是否可以在 Eclipse 中使用来自 apache 的 derby?