我一直在 VSC 的 Node 开发中使用 devcontainers 并且喜欢我可以提交共享配置以确保团队中的每个人都有相同的运行时/构建时间的想法。我一直在寻找一种类似的方式来配置 IntelliJ,但在确定这是否可行时遇到了一些困难。
我正在运行 IntelliJ 2020.2 并安装了 Node Remote Interpreter 插件。
在我的 devcontainer 中,我将一个 Docker 卷映射node_modules到我的工作区,这样我所有不同的容器都可以共享同一个卷,而无需每次都重新下载一组 npm 模块。
我已经设置并创建了一个适当的运行/调试 Docker 配置,当我启动它时,容器已正确构建和配置。但是,在 IntelliJ 中,可以理解的是,该node_modules文件夹仍然是空白的(因为该文件夹仅安装在远程容器中)。
同样,我已经设置了一个指向我的 docker 映像的远程节点运行配置,但类似地,IntelliJ 没有看到任何应该在 node_modules 文件夹中的库。
有什么方法可以在 IntelliJ 中使用这种配置,以便 IDE 理解我在 Docker 容器中创建的映射?
我刚从Eclipse Indigo(3.7)升级到Eclipse Juno(4.2),我的WSDL在Indigo中没有任何问题进行验证,我现在得到一个奇怪的警告和错误,我不明白.
WSDL片段:
<wsdl:types>
<xsd:schema
targetNamespace="http://www.domain.com/ClientServices/LendingSimulation/V1"
xmlns:cpReq="http://www.domain.com/ClientServices/LendingSimulation/CalculateProfitabilityRequest"
xmlns:cpRes="http://www.domain.com/ClientServices/LendingSimulation/CalculateProfitabilityResponse"
xmlns:error="http://www.domain.com/fw/errorMgmt">
<xsd:import namespace="http://www.domain.com/ClientServices/LendingSimulation/CalculateProfitabilityRequest" schemaLocation="CalculateProfitabilityRequest.xsd" />
<xsd:element name="calculateProfitabilityRequest" type="cpReq:CalculateProfitabilityRequestType" />
</xsd:schema>
</wsdl:types>
Run Code Online (Sandbox Code Playgroud)
Juno使用以下警告标记xsd:import行:
XSD: The location 'CalculateProfitabilityRequest.xsd' has not been resolved
Run Code Online (Sandbox Code Playgroud)
然后标记xsd:element行,并显示以下错误:
XSD: Type reference 'http://www.domain.com/ClientServices/LendingSimulation/CalculateProfitabilityRequest#CalculateProfitabilityRequestType' is unresolved
Run Code Online (Sandbox Code Playgroud)
我很难过.我不仅不理解警告或错误消息的含义,我不明白为什么Juno将此标记为问题,但在Indigo中没有问题.如果我按Ctrl键单击schemaLocation,Eclipse将打开相关的xsd文件,因此Eclipse不会找到该文件.
我试过清理这个项目,但它没有任何区别.
编辑
我咬紧牙关,决定重新安装Indigo Java EE(3.7).但是,现在当我加载我的项目时,我得到了与Juno相同的错误!所以它似乎不是Juno本身,而是我配置中的某些东西是不正确的.但是,我不知道在哪里可以找到问题,或者为什么Eclipse抱怨该位置没有得到解决.这几乎就像我必须以某种方式预装Eclipse中的文件,但我不知道如何.
如果我删除项目,并将项目重新加载为现有Maven项目,则所有警告和错误消息都将消失.但是,该项目随后与我的SCM无关.如果我通过SCM加载它,那么我会重新发生此错误.我猜测项目配置必须有一些东西,但是方面是相同的,所以我不知道哪个配置是不同的.无论如何要告诉?
任何想法或建议赞赏!
我有一个bash脚本(cygwin),它使用了一些带有空格的窗口路径.因此,我在变量定义中使用\来逃避空间.脚本中的所有内容都可以正常工作.但是,我需要将此变量作为参数传递给命令行可执行文件.当我这样做时,我的逃避变得混乱.
示例非功能脚本:
#!/bin/sh
# File paths
destinationPath="/cygdrive/c/Documents and Settings/Eric/My Documents/"
attachments="\n2013-12-12.pdf"
body="Test Body"
recipient="asdf@asdf.com"
# Prepare attachments
args=""
for file in $attachments ; do
file=${file//[ \\n]/}
touch $file
mv $file "$destinationPath/$file"
args="$args -a $destinationPath/$file"
done
# Send email
echo -e $body | email --from-addr nosender@mydomain.com --from-name "Automated CSS Downloader" --subject "Downloaded new file(s) \
from CSS" $args eric@mydomain.com
Run Code Online (Sandbox Code Playgroud)
脚本输出:
$ bash -x test.sh
+ destinationPath='/cygdrive/c/Documents and Settings/Eric/My Documents/'
+ attachments='\n2013-12-12.pdf'
+ body='Test Body'
+ recipient=asdf@asdf.com
+ args=
+ for file …Run Code Online (Sandbox Code Playgroud) 我正在开始一个新的Spring项目,并决定试用Spring Roo.在设置持久层时,我看到Spring Roo支持(实际上甚至默认为)ActiveRecord模式.虽然我过去一直是DAO/DTO粉丝,但Roo使用ActiveRecord模式非常好,因为它似乎"隐藏"apsect文件中的大多数ActiveRecord方法.
有没有人知道为什么当Spring Data在提供/隐藏CRUD(典型的DAO模式)方面做得如此漂亮时,Spring Roo开发人员会默认ROO使用AR模式?Spring是否试图让更多人使用AR模式而不是Repo模式?
我可能缺少明显的东西,但是我试图在运行应用程序时以编程方式找出如何通过Spring Boot SpringApplication设置/覆盖属性。
默认情况下,我知道我可以将命令行参数传递给启动应用程序,但是我想将spring boot应用程序嵌入另一个Java应用程序中,并从父应用程序中执行。我已将其作为对我项目的依赖项。
在我的Spring Boot应用程序中,我具有以下内容:
static public main(String [] args){
SpringApplication app = new SpringApplication(Sync.class);
app.setWebEnvironment(false);
app.setShowBanner(false);
app.run(args);
}
Run Code Online (Sandbox Code Playgroud)
这使我可以设置命令行参数,例如--userName=Ericetc。
尽管我意识到我可以在技术上以编程方式进行同样的操作,并--userName=Eric在代码中添加到args []数组中,但我认为必须存在另一种更干净/更整洁的方式来将参数/属性传递给我app。但是我似乎找不到其他方法SpringApplication可以设置这种类型的值。
我正在寻找可以让我做以下事情的东西:
app.setProperty("username", "Eric");
Run Code Online (Sandbox Code Playgroud)
我是否缺少明显的东西?
从 Servlet 3.0 开始,我们现在可以通过注释(@WebFilter)或动态(通过ServletContext对象)声明 Web 过滤器。
我知道使用 @WebFilter 不允许指定过滤器顺序。同样,当通过ServletContext.addFilter()方法动态声明它时,我还没有找到任何指定顺序的方法。我已经查看了 FilterRegistration 对象,但那里也没有任何内容。
这是否意味着在过滤器链中指定过滤器顺序的唯一方法是通过 web.xml?没有其他可用的机制吗?这不是对 Servlet 3.0+ 的重大疏忽吗?
通过注释或 ServletContext 对象声明的过滤器在链中的哪个位置?那些在web.xml中声明的结尾?不明确的?
我在这里遇到了一个奇怪的结果,我不确定它是Java中的错误还是预期的行为.我有一个内部类,我使用反射来获取声明的字段(class.getDeclaredFields()).但是,当我循环遍历字段列表并检查各个类型时,"this"字段返回外部类而不是内部类.
这是预期的行为吗?这对我来说似乎很奇怪.
例如:
import java.lang.reflect.Field;
public class OuterClass {
public class InnerClass{
public String innerClassString;
public InnerClass innerClass;
}
public static void main(String[] args) {
// print the fields of the inner class
for( Field field : OuterClass.InnerClass.class.getDeclaredFields())
System.out.println( field.getName() + " ::: " + field.getType());
}
}
Run Code Online (Sandbox Code Playgroud)
输出:
innerClassString ::: class java.lang.String
innerClass ::: class OuterClass$InnerClass
this$0 ::: class OuterClass
Run Code Online (Sandbox Code Playgroud)
我希望这个$ 0是OuterClass.InnerClass类型.
这是一个Java错误吗?反正有办法解决这个意想不到的行为吗?
谢谢,
埃里克
java ×3
activerecord ×1
bash ×1
docker ×1
eclipse-juno ×1
escaping ×1
field ×1
ifs ×1
node.js ×1
reflection ×1
servlet-3.0 ×1
spring ×1
spring-boot ×1
spring-data ×1
spring-roo ×1
variables ×1
web.xml ×1
wsdl ×1
xsd ×1