IntelliJ无法看到依赖类

时间:2017-11-29 05:00:49

标签: java spring maven intellij-idea

我有两个maven项目,我想用一个作为对另一个的依赖。现在,我使用<?php $servername = "localhost"; $username = "root"; $password = ""; $db = "item"; $conn = new mysqli($servername, $username, $password, $db); $jsondata = file_get_contents( $_FILES['file']['tmp_name']); $data = json_decode($jsondata, true); $gstin = $data['gstin']; $fp = $data['fp']; $stmt = "INSERT INTO gstin (gstin, fp) VALUES('$gstin', '$fp')"; mysqli_query($conn, $stmt); foreach ($data['b2b'] as $row1) { $ctin = $row1['ctin']; $cfs = $row1['cfs']; $stmt = "INSERT INTO b2b (ctin, cfs) VALUES('$ctin', '$cfs')"; mysqli_query($conn, $stmt); foreach($row1['inv'] as $row3){ $val = $row3['val']; $inv_typ = $row3['inv_typ']; $flag = $row3['flag']; $updby = $row3['updby']; $pos = $row3['pos']; $idt = $row3['idt']; $rchrg = $row3['rchrg']; $cflag = $row3['cflag']; $inum = $row3['inum']; $chksum = $row3['chksum']; $stmt = "INSERT INTO inv (val, inv_typ, flag, updby, pos, idt, rchrg, cflag, inum, chksum) VALUES('$val', '$inv_typ', '$flag', '$updby', '$pos', '$idt', '$rchrg', '$cflag', '$inum', '$chksum')"; $result = mysqli_query($conn, $stmt); foreach($row3['inv'][0]['itms'] as $row2){ (isset($row2['itc']['tx_cs'])) ? $tx_cs=$row2['itc']['tx_cs'] : null; $elg = $row2['itc']['elg']; (isset($row2['itc']['tx_i'])) ? $tx_i = $row2['itc']['tx_i'] : null; (isset($row2['itc']['tx_c'])) ? $tx_c =$row2['itc']['tx_c'] : null; (isset($row2['itc']['tx_s'])) ? $tx_s = $row2['itc']['tx_s'] : null; (isset($row2['itm_det']['samt'])) ? $samt = $row2['itm_det']['samt'] : null; (isset($row2['itm_det']['csamt'])) ? $csamt = $row2['itm_det']['csamt'] : null; (isset($row2['itm_det']['iamt'])) ? $iamt = $row2['itm_det']['iamt'] : null; (isset($row2['itm_det']['camt'])) ? $camt = $row2['itm_det']['camt'] : null; $rt = $row2['itm_det']['rt']; $txval = $row2['itm_det']['txval']; $stmt = "INSERT INTO itms (tx_cs, elg, tx_i, tx_c, tx_s, samt, csamt, rt, txval, camt, iamt) VALUES('$tx_cs', '$elg', '$tx_i', '$tx_c', '$tx_s', '$samt', '$csamt', '$rt', '$txval', '$camt', '$iamt')"; $result = mysqli_query($conn, $stmt); } } } 构建了project1,并将其添加到project2,如下所示:

mvn clean install

我可以在project2外部库文件夹中看到这个jar及其所有类。让我们说这个项目有<dependency> <groupId>com.foo</groupId> <artifactId>project1</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> 课程。当我尝试键入此类的名称时,IntelliJ会在上下文菜单中显示它,以便它知道它的存在。但是,只要我尝试实例化MyClass IntelliJ就说com.foo.MyClass。我是Spring的新手,所以我不确定这是否是我的代码或某种IntelliJ错误的问题。

0 个答案:

没有答案