mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.2:tree -DoutputFile=/tmp/dependencies.txt -DoutputType=dot -DappendOutput=true
Run Code Online (Sandbox Code Playgroud)
我使用上面的命令来获取依赖项列表,即直接依赖项和传递依赖项。我想要对上述命令进行更改,这将给我一个仅包含直接依赖项的列表,并忽略所有传递依赖项。我不想使用任何其他命令,也不想更改输出文件格式。我们的解析器依赖于输出文件格式。有人对此有任何解决方案吗?
在((++))的第一个参数中,“ show a”的使用不会导致(Show a)的实例。
data LTree a = Leaf a | Node (LTree a) (LTree a)
instance Show (LTree a) where
show (Leaf a) = "{" ++ show a ++ "}"
show (Node fe fd) = "<" ++ (show fe)++ "," ++(show fd)++ ">"
Run Code Online (Sandbox Code Playgroud)
Node (Leaf 1) (Node (Node (Leaf 3) (Leaf 4)) (Node (Leaf 8) (Leaf 7)))
Run Code Online (Sandbox Code Playgroud)
我应该得到:
<{1},<<{3},{4}>,<{8},{7}>>>
Run Code Online (Sandbox Code Playgroud)