首页 \ 问答 \ eclipse中的Maven动态Web项目为依赖项目部署无效的jar文件(Maven dynamic web project in eclipse deploys invalid jar files for dependent project(s))

eclipse中的Maven动态Web项目为依赖项目部署无效的jar文件(Maven dynamic web project in eclipse deploys invalid jar files for dependent project(s))

我有一个导入eclipse的maven web项目。 我有另一个maven项目(生成一个jar文件),该web项目依赖。

这两个项目在从命令行执行时都可以正常工作。 mvn包创建一个war文件,该文件从web项目的maven存储库中获取它所依赖的jar文件。 运行库时,mvn包会创建一个有效的jar文件。

当我将库导入Eclipse时,m2e认识到Web项目依赖于库并更新了项目的某些部分,以利用这两个Maven项目都驻留在单个Eclipse工作区中的事实。 Web项目的“Java Build Path”首选项的“Libraries”选项卡的“Maven Dependencies”部分将删除库jar文件并将其替换为库项目。 随着库在Eclipse中进行更新,Web项目可识别这些更改,而无需安装/部署库。

当我尝试在Eclipse中运行Web应用程序时,会发生该问题。 由于Eclipse实际上是针对Eclipse中的库版本构建Web项目的,因此它不会从Maven存储库部署库文件,它会创建一个新的jar文件,该文件是Eclipse中当前版本库的快照。 所有这些对我来说一般都很好,但是在我正在处理的项目中,Eclipse正在创建的jar文件存在问题。 而不是插入库的类文件,它似乎将我的Maven项目的“src”目录并将其压缩为jar文件。 jar文件的内容如下所示:

-main
  -java
    -com
      -... *.java
  -resources
    -...
-test
  -java
    -com
      -... *.java

我期望它看起来更像是:

-com
  -... *.class

既然我已经成功地使用过这种类型的项目,我试图弄清楚是否需要配置一些东西,或者如果我碰到一个bug。

我在Eclipse Indigo上使用最新的m2e(1.0.200.20111228-1245)更新(Build ID:20120216-1857)。


I have a maven web project that imported into eclipse. I have another maven project (generates a jar file) that the web project depends on.

Both of these projects work correctly when executed from the command line. mvn package creates a war file which pulls the jar it depends on from the maven repository for the web project. mvn package creates a valid jar file when run for the library.

When I import the library into Eclipse, m2e recognizes that the web project depends on the library and updates parts of the project to take advantage of the fact that both maven projects are hosted within a single Eclipse workspace. The "Maven Dependencies" section of the "Libraries" tab of the "Java Build Path" preference for the web project removes the library jar file and replaces it with the library project. As the library is updated in Eclipse, the web project recognizes those changes without having to install/deploy the library.

The problem occurs when I attempt to run the web application in Eclipse. Because Eclipse is actually building the Web project against the version of the library in Eclipse, it does not deploy the library file from the maven repository, it creates a new jar file that's a snapshot of the current version of the library in Eclipse. All of this has generally worked well for me, but on the project I'm currently working on there's a problem with the jar file that Eclipse is creating. Instead of inserting the class files for the library, it appears that it's taking the "src" directory of my Maven project and zipping it up as the jar file. The contents of the jar file look something like:

-main
  -java
    -com
      -... *.java
  -resources
    -...
-test
  -java
    -com
      -... *.java

Where I would expect it to look more like:

-com
  -... *.class

Since I have successfully used this type of project before, I'm trying to figure out if there's something I need to configure or if I've just run into a bug.

I'm using the latest update of m2e (1.0.200.20111228-1245) on Eclipse Indigo (Build id: 20120216-1857).


原文:https://stackoverflow.com/questions/9710925
更新时间:2023-05-13 20:05

最满意答案

问题不在于Greenplum,命令失败的是socket.getaddrinfo(hostToPing, None) 。 很可能你在机器上运行selinux,禁用它


So i fixed the issue by adding a mapping to the /etc/hosts file..i have no idea what broke it in the first place but it is working for now

Reference :- https://support.pivotal.io/hc/communities/public/questions/203012917-cannot-start-greenplum-gpstart-failed

相关问答

更多
  • 您无法在Greenplum的交易中开始或结束交易。 它会自动提交或自动回滚。 多版本并发控制,始终存在数据一致性,并且查询始终在并行机制内按顺序执行。 重试: - 标签重试开始 truncate table tablename select pg_sleep(5) -- Wait for 5 ms Insert into tablename RAISE INFO 'Rollback Transaction' IF ERROR_NUMBER = 1205 -- Deadlock Error Number ...
  • 回答你的问题:“我想建立从sql到greenplum数据库的连接”......对于你指的是哪个SQL数据库是不明确的。 此外,没有直接连接驱动程序可用于将非greenplum数据库连接到greenplum数据库。 但是,如果您想将数据从Oracle迁移到Greenplum,那么您可以使用Informatica的快速克隆工具。 回答关于gpfdist和gpload的第二部分问题。 GPFDIST是一个在主机系统上运行的文件分发过程,它可以并行处理许多段文件。 当初始化外部表从文件读取/写入时,您需要指定哪个进 ...
  • 不,Greenplum必须在扩展阶段停止,但在添加更多节点/分段后,数据的重新分配可以在用户在数据库中处于活动状态时完成。 或者,Pivotal HDB(基于Apache HAWQ)确实具有动态虚拟段,您甚至可以在查询级别进行控制。 优化器根据查询的成本控制查询使用多少段,但您也可以提供更多段来真正利用集群中可用的资源。 No, Greenplum must stop during the expansion phase but after it adds more nodes/segments, the ...
  • 好的,它可以做到。 我已经测试过,只需安装不同的路径,用户所有者和端口。 防爆。 GPDB 4.2.5.2 /usr/local/greenplum-db-4.2.5.2 所有者是“gpadm4252”用户 端口基础从40000开始(段主机) 主人主持人是5432 GPDB 4.2.6.2 /opt/greenplum-db-4.2.6.2 所有者是“gpadm4262”用户 端口基础从45000开始(段主机) 主帖是6432 OK, It can do. I already tested, just in ...
  • 问题不在于Greenplum,命令失败的是socket.getaddrinfo(hostToPing, None) 。 很可能你在机器上运行selinux,禁用它 So i fixed the issue by adding a mapping to the /etc/hosts file..i have no idea what broke it in the first place but it is working for now Reference :- https://support.pivota ...
  • 您将需要对Greenplum和PostgreSQL中的数据范围进行并行COPY 。 确保PostgreSQL设置为快速数据加载。 如果可能,请使用UNLOGGED表; 否则至少使用wal_level = 'minimal' 。 有多少并行工作者依赖于PostgreSQL服务器的I / O子系统。 测试看看。 我建议使用Python和psycopg2以及copy_expert游标函数。 查看文档 。 使用管道进行多处理,在读写器工作者之间共享类似文件的对象,读取器连接到greenplum,编写器连接到Post ...
  • DISTRIBUTED BY是Greenplum如何确定哪个段将存储每一行。 由于Greenplum是大多数生产数据库中的MPP数据库,因此您将拥有多个分段服务器。 您希望确保“分发”列是您将加入的列。 temp_table是将在Greenplum集群上为您创建的表。 如果您尚未将search_path设置为其他内容,则它将位于公共模式中。 DISTRIBUTED BY is how Greenplum determines which segment will store each row. Becaus ...
  • 尝试这个: UPDATE IncrementalLoad_Dest_dbo.tblDest d SET d.ColA = s.ColA, d.ColB = s.ColB, d.ColC = s.ColC FROM IncrementalLoad_Source_dbo.tblSource s WHERE s.ColID = d.ColID and ((d.ColA != s.ColA) OR (d.ColB != s.ColB) OR (d.ColC != s.ColC)); 您基本上必须 ...
  • gpfdist将在ETL服务器上运行,而不是在主控主机上运行。 您必须将ETL服务器ip和name添加到Greenplum集群中所有节点上的/ etc / hosts文件中。 然后,您需要确保ETL服务器可以直接与Greenplum专用网络中的段主机通信。 这需要将Greenplum使用的10GB私有交换机连接到10GB LAN并创建VLAN以便您可以访问节点,或者您可以从ETL服务器运行10GB电缆以打开10GB交换机的端口并为其分配IP地址与现有主机不冲突。 gpfdist will run on th ...
  • 虽然我不知道究竟是什么原因,但我可以解决这个错误。 然而,第一次,我在一次性完成所有步骤时遇到了很多问题(很多先决条件都不清楚)因此我可能在此错误中结束了。 所以我拿了一台干净的机器,尝试了以下所有步骤。 还要确保在开始第一步之前添加了以下必备软件包。 先决条件1.以gpadmin身份创建新用户。 为该用户设置密码2.确保密码少ssh从root用户以及从同一用户到localhost。 3.仅将所有步骤作为新用户的一部分。 4.首先安装下面的软件包yum install -y zlib * yum insta ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)