Project entries not supported.

解决Maven项目在Eclipse中引入依赖包时的Classpath错误

我想在test_spring_web中加入test_spring_service项目的jar包,test_spring_service已在本地仓库中存在,为什么还会报出Invalid classpath publish/export dependency /mvn_service. Project entries not supported.的错误?

 

 

不要动eclipse.在控制台执行:mvn eclipse:eclipse,然后刷新eclipse的项目试试.再不行就在pom中的plugins节点内加:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <additionalProjectnatures>
                        <projectnature>org.eclipse.jdt.core.javanature</projectnature>
                        <!-- 
                        <projectnature>org.eclipse.m2e.core.maven2Nature</projectnature>
                        <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                         -->
                    </additionalProjectnatures>
                    <additionalBuildcommands>
                        <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
                        <!-- 
                        <buildcommand>org.eclipse.m2e.core.maven2Builder</buildcommand>
                        <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                         -->
                    </additionalBuildcommands>
                </configuration>
            </plugin>

 

然后再 

 

mvn eclipse:clean

mvn eclipse:eclipse

 

一般的eclipse的项目空间有.project和.classpath两个文件.执行eclipse:eclipse就是让maven的eclipse插件把.classpath内的jar引用地址重新更新一遍. eclipse:clean就是删除所有eclipse项目文件在用eclipse:eclipse重建

 

当然,上面的是复制别人的。

我的解决方案是:

是否所依赖的包是最新的包?

所以先更新该包。

然后Project celan 

npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated gauge@4.0.4: This package is no longer supported. npm warn deprecated are-we-there-yet@3.0.1: This package is no longer supported. npm warn deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated npmlog@6.0.2: This package is no longer supported. npm warn deprecated gm@1.25.1: The gm module has been sunset. Please migrate to an alternative. https://github.com/aheckmann/gm?tab=readme-ov-file#2025-02-24-this-project-is-not-maintained npm warn deprecated lodash.get@4.4.2: This package is deprecated. Use the optional chaining (?.) operator instead. npm warn deprecated @aws-sdk/signature-v4@3.374.0: This package has moved to @smithy/signature-v4 npm warn deprecated @aws-sdk/protocol-http@3.374.0: This package has moved to @smithy/protocol-http npm warn deprecated infisical-node@1.3.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated rimraf@2.6.3: Rimraf versions pr
08-07
def main(): """ 主函数:注入 DEFAULT 功率表 使用项目根目录自动推导路径,不依赖当前工作目录 """ import sys from pathlib import Path project_root = Path(__file__).parent.parent # F:\issue CONFIG_FILE = project_root / "config" / "config.json" GENERATED_FILE = project_root / "output" / "tx_limit_table.c" TARGET_C_FILE = project_root / "input" / "wlc_clm_data_6726b0.c" # 检查必要文件 for path, desc in [(CONFIG_FILE, "配置文件"), (GENERATED_FILE, "生成数据文件"), (TARGET_C_FILE, "目标C文件")]: if not path.exists(): print(f"❌ {desc}不存在: {path}", file=sys.stderr) sys.exit(1) try: gen_content = GENERATED_FILE.read_text(encoding='utf-8') base_block = PowerTableSynchronizer._extract_locale_block(gen_content, "DEFAULT") ht_block = PowerTableSynchronizer._extract_locale_block(gen_content, "DEFAULT_HT") if not base_block and not ht_block: raise ValueError("未提取到任何 DEFAULT 功率表数据") locale_entries = { "locale_2g_idx": "LOCALE_2G_IDX_DEFAULT" } power_tables = {} if base_block: power_tables["2g_base_DEFAULT"] = ( f"static const unsigned char locales_2g_base_DEFAULT[] = {{\n {base_block}\n}}" ) if ht_block: power_tables["2g_ht_DEFAULT"] = ( f"static const unsigned char locales_2g_ht_DEFAULT[] = {{\n {ht_block}\n}}" ) country_entries = [ 'REGION("CN", LOCALE_2G_IDX_DEFAULT)', 'REGION("US", LOCALE_2G_IDX_DEFAULT)', ] synchronizer = PowerTableSynchronizer( c_file_path=str(TARGET_C_FILE), config_path=str(CONFIG_FILE), dry_run=False ) synchronizer.sync_all( locale_entries=locale_entries, power_tables=power_tables, country_entries=country_entries ) print("✅ 成功注入 DEFAULT 功率表!") except Exception as e: print(f"💥 错误: {e}", file=sys.stderr) sys.exit(1) 和 def run_power_sync(self): """运行功率表同步:提取 tx_limit_table.c 中的 DEFAULT 数据,注入到目标 .c 文件""" target_c_path = self.c_file_path.text().strip() if not target_c_path: self.log("❌ 未指定目标 C 文件,请先设置!") return generated_table_path = Path("output") / "tx_limit_table.c" config_path = self.config_path.text().strip() or "config/config.json" if not generated_table_path.exists(): self.log(f"❌ 无法找到生成的功率表文件: {generated_table_path}") self.log("📌 请先点击【开始生成】以生成 tx_limit_table.c") return try: self.log("📊 正在读取生成的功率表数据...") gen_content = generated_table_path.read_text(encoding='utf-8') # 提取 DEFAULT 功率表(Base 和 HT) base_block = PowerTableSynchronizer._extract_locale_block(gen_content, "DEFAULT") ht_block = PowerTableSynchronizer._extract_locale_block(gen_content, "DEFAULT_HT") if not base_block and not ht_block: self.log("⚠️ 未提取到任何 DEFAULT 功率表数据(检查是否生成了正确的 Locale)") return # 构造 locale_entries selected_locale_idx = self.power_locale_combo.currentText() idx_name = f"LOCALE_2G_IDX_{selected_locale_idx}" locale_entries = { "locale_2g_idx": idx_name } # 构造 power_tables prefix = "locales_" suffix = "[MAX_STREAMS_SUPPORTED][MODULATION_MODES]" power_tables = {} if base_block: key = "2g_base_DEFAULT" declaration = ( f"static const unsigned char {prefix}2g_base_DEFAULT[] = {{\n {base_block}\n}}" ) power_tables[key] = declaration self.log(f"📌 准备注入 2G Base 表") if ht_block: key = "2g_ht_DEFAULT" declaration = ( f"static const unsigned char {prefix}2g_ht_DEFAULT[] = {{\n {ht_block}\n}}" ) power_tables[key] = declaration self.log(f"📌 准备注入 HT 表") # 构造 country_entries(示例) country_entries = [ f'REGION("CN", {idx_name})', f'REGION("US", {idx_name})', f'REGION("EU", {idx_name})' ] self.log(f"🌍 将为 CN/US/EU 注入国家码映射至 {idx_name}") # 创建同步器并执行 synchronizer = PowerTableSynchronizer( c_file_path=target_c_path, config_path=config_path, dry_run=False # 可改为 True 测试 ) self.log("🔄 开始注入功率表和国家码...") synchronizer.sync_all( locale_entries=locale_entries, power_tables=power_tables, country_entries=country_entries ) self.log("✅ 功率表与国家码同步完成!") QMessageBox.information(self, "成功", "功率表与国家码已成功注入目标C文件!") except Exception as e: self.log(f"❌ 功率表同步失败: {str(e)}") import traceback self.log(f"📝 错误详情:\n{traceback.format_exc()}") QMessageBox.critical(self, "错误", f"同步过程出错:{str(e)}")有什么区别
最新发布
10-16
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值