我试图在我的bash(3.2.25)中加载bash_completion,它不起作用.没有消息等我在.bashrc中使用了以下内容
if [ -f ~/.bash_completion ]; then
. ~/.bash_completion
fi
Run Code Online (Sandbox Code Playgroud)
我也尝试使用.bash_profile,但结果相同.所以问题是它为什么不起作用?任何的想法?提示?
最近不得不将Jersey的版本从2.5.1(稍后解释)升级到2.7并且自升级以来,每次我将代码上传到服务器时,随机API调用开始失败,使用以下堆栈跟踪:
org.glassfish.jersey.internal.Errors logErrors: The following warnings have been detected: WARNING: HK2 service reification failed for [com.example.rest.LeaderboardApi] with an exception:
MultiException stack 1 of 2
java.lang.NullPointerException
at org.jvnet.hk2.internal.Utilities.hasInjectAnnotation(Utilities.java:1484)
at org.jvnet.hk2.internal.Utilities.findInitializerMethods(Utilities.java:1425)
at org.jvnet.hk2.internal.DefaultClassAnalyzer.getInitializerMethods(DefaultClassAnalyzer.java:102)
at org.glassfish.jersey.internal.inject.JerseyClassAnalyzer.getInitializerMethods(JerseyClassAnalyzer.java:239)
at org.jvnet.hk2.internal.Utilities.getInitMethods(Utilities.java:243)
at org.jvnet.hk2.internal.ClazzCreator.initialize(ClazzCreator.java:163)
at org.jvnet.hk2.internal.ClazzCreator.initialize(ClazzCreator.java:200)
at org.jvnet.hk2.internal.SystemDescriptor.internalReify(SystemDescriptor.java:649)
at org.jvnet.hk2.internal.SystemDescriptor.reify(SystemDescriptor.java:604)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:405)
at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2046)
at org.jvnet.hk2.internal.ServiceLocatorImpl.access$700(ServiceLocatorImpl.java:116)
at org.jvnet.hk2.internal.ServiceLocatorImpl$6.compute(ServiceLocatorImpl.java:1011)
at org.jvnet.hk2.internal.ServiceLocatorImpl$6.compute(ServiceLocatorImpl.java:1006)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:115)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:111)
at java.util.concurrent.FutureTask.run(FutureTask.java:260)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.run(LRUHybridCache.java:173)
at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:292)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetDescriptor(ServiceLocatorImpl.java:1093)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:616)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:606)
at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:173)
at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:185)
at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:74)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:115)
at …Run Code Online (Sandbox Code Playgroud) 我想对 maven 过滤器标签以及它如何对应于插件 properties-maven-plugin 中的文件标签进行解释。
有问题的个人资料:
<profile>
<id>local-spm-caefeeder-preview</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<quiet>true</quiet>
<files>
<file>${main.basedir}/src/config/global.properties</file>
<file>${main.basedir}/src/config/caefeeder/caefeeder_global.properties</file>
<file>${main.basedir}/src/config/caefeeder/caefeeder_preview.properties</file>
<file>${main.basedir}/src/config/local.properties</file>
<file>${main.basedir}/src/config/${user.name}.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<filters>
<filter>${main.basedir}/src/config/caefeeder/caefeeder_global.properties</filter>
<filter>${main.basedir}/src/config/caefeeder/caefeeder_preview.properties</filter>
<filter>${main.basedir}/src/config/local.properties</filter>
<filter>${main.basedir}/src/config/${user.name}.properties</filter>
</filters>
</build>
</profile>
Run Code Online (Sandbox Code Playgroud)
根据我的研究过滤器定义了其中包含需要替换的变量的文件。“properties-maven-plugin”是否从文件标签中定义的文件中提供这些变量?
我正在为我的应用程序编写构建脚本,并且想知道在test/prod环境中部署/发布的最佳实践是什么.
目前我所写的是
我知道它不是部署应用程序的最佳方式,并希望得到您的反馈.我理想的做法是
我很困惑这个步骤4应该是在Jenkins还是在服务器上.我正在使用EC2实例来托管Web应用程序,因此我的图像需要有脚本.
我有一个.gitignore包含该target目录的文件。现在我意识到 git git 不会删除目录中的 git 存储库,target即使我这样做:
$ git clean -fdx
Skipping repository target/x
Run Code Online (Sandbox Code Playgroud)
有没有解决方案来处理这个问题?特殊配置选项?因为我已经给予了-f力量等?
更新:
我可以target通过以下手动步骤在目录中手动创建存储库:
maven-it-extension (issue-21)$ git st
On branch issue-21
Your branch is up to date with 'origin/issue-21'.
nothing to commit, working tree clean
maven-it-extension (issue-21)$ mkdir target/x
mkdir: target: No such file or directory
maven-it-extension (issue-21)$ mkdir -p target/x
maven-it-extension (issue-21)$ cd target/x/
x (issue-21)$ git init .
Initialized empty Git repository in /Users/khmarbaise/ws-git-apache/maven-it-extension/target/x/.git/
x (master …Run Code Online (Sandbox Code Playgroud) 我正在使用cypress为html网站编写一些测试..
以下tr内容从我的HTML网站上的表中正确选择了一个元素.网站内容如下所示:
<tr data-recordid="theId">
<td...><div ..>Text 1</div></td>
<td...><div ..>Text 2</div></td>
<td...><div ..>Text 3</div></td>
</tr>
Run Code Online (Sandbox Code Playgroud)
以下测试脚本片段正确选择了我的单个<tr..>部分.
cy.get('tr[data-recordid="theId"]').contains('Text')
Run Code Online (Sandbox Code Playgroud)
现在我想选择<div>..</div> 标签中的文本.我首先试图为第一个<div>..</div>标签链接一个调用,如下所示:
cy.get('tr[data-recordid="theId"]').get('div').contains('Text')
Run Code Online (Sandbox Code Playgroud)
这不符合我的预期.该get()呼叫链jQuery的调用(基于Cypress的文档).所以看起来我误解了JQuery中的工作原理.
我期待的是如何检查所有div元素(不工作):
cy.get('tr[data-recordid="theId"]')..SomeHowMagic
.get('td[alt="xyz"]".get('div').contains('Text 1')
.get('td...').get('div').contains('Text 2')
.get('td...').get('div').contains('Text 3')
Run Code Online (Sandbox Code Playgroud)
知道如何迈出一步吗?遗漏任何信息只是发表评论.
我有一个 Spring Boot 应用程序 (1.5.10.RELEASE),其中包含一个主要的 (SpringBootApplication),如下所示:
@SpringBootApplication
@Configuration
@EntityScan(basePackages = { "db.modell", "db.modell.base" })
@ComponentScan(basePackages = { "de.gui.test" })
public class SpringBootConsoleApplication {
public static void main(String[] args) throws Exception {
SpringApplication.run(SpringBootConsoleApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
和两个 REST 控制器,如下所示:
@RestController
@RequestMapping("/as")
public class AController {
@Autowired
private ARepository aRepository;
@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<Collection<A>> getAs() {
return new ResponseEntity<>(orgtFarbeRepository.findAll(), HttpStatus.OK);
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public ResponseEntity<A> getA(@PathVariable long id) {
A a = ARepository.findOne(id);
if (party != null) …Run Code Online (Sandbox Code Playgroud) 目前,我有一个包含以下内容的角度组件 x.component.html(使用角度材料):
<div class="example-container mat-elevation-z8">
<div class="example-header">
<mat-form-field>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
</div>
<mat-table #table [dataSource]="dataSource">
<ng-container matColumnDef="farbeKey">
<mat-header-cell *matHeaderCellDef> farbeKey </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.farbeKey}} </mat-cell>
</ng-container>
....
Run Code Online (Sandbox Code Playgroud)
此外,我有x.component.ts看起来像这样的组件:
<div class="example-container mat-elevation-z8">
<div class="example-header">
<mat-form-field>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
</div>
<mat-table #table [dataSource]="dataSource">
<ng-container matColumnDef="farbeKey">
<mat-header-cell *matHeaderCellDef> farbeKey </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.farbeKey}} </mat-cell>
</ng-container>
....
Run Code Online (Sandbox Code Playgroud)
但是问题是,如果尝试在浏览器中访问它,则会收到以下错误消息(这仅是摘录):
Uncaught Error: Bootstrap's JavaScript requires jQuery
at scripts.bundle.js:8
(anonymous) @ scripts.bundle.js:8
compiler.js:485 Uncaught Error: …Run Code Online (Sandbox Code Playgroud) 我有一个有点不寻常的问题。我目前正在尝试在 Java 16 中编写一个用于处理不和谐的聊天过滤器。
\n在这里我遇到了一个问题,在德语中,有几种方法可以编写一个单词来绕过这个过滤器。
\n作为一个例子,我现在以侮辱“Hurensohn”为例。\n现在你可以简单地在聊天中写“Hur \xc3\xa4 nsohn”或“Hur 3 nsohn”,从而很容易地绕过过滤器。
\n由于我不想手动将所有可能性打包到过滤器中,所以我考虑了如何自动完成它。所以我做的第一件事是创建一个包含所有可能的替代字母的哈希图,它看起来像这样:
\nMap<String, List<String>> alternativeCharacters = new HashMap<>();\nalternativeCharacters.put( "E", List.of( "\xc3\xa4", "3" ) );\nRun Code Online (Sandbox Code Playgroud)\n我尝试更改单词中对应的字母并将其添加到聊天过滤器中,这确实有效。
\n但现在我们遇到了问题:\n为了能够覆盖所有可能的组合,仅更改单词中的一种类型的字母对我来说并没有多大好处。
\n如果我们现在取单词“Einschalter”并更改此处的字母“e”,我们也可以简单地将此处的“e”更改为“3”或“\xc3\xa4”,从而会出现以下结果:
\n和
\n但现在我也想创造“混合”词。例如“3inschal\xc3\xa4r”,其中“\xc3\x84”和“3”都用于创建单词。然后会出现以下组合:
\n有谁知道我怎样才能实现这样的事情?使用普通的 Replace() 方法,我还没有找到创建“混合”替换的方法。
\n我希望人们理解我有什么样的问题以及我想做什么。:D
\n目前用于替换的方法:
\n public static List<String> replace( String word, String from, String... to ) {\n\n …Run Code Online (Sandbox Code Playgroud) java ×3
javascript ×2
maven ×2
angular ×1
bash ×1
cypress ×1
deployment ×1
git ×1
gitignore ×1
html ×1
java-16 ×1
jenkins ×1
jersey-2.0 ×1
jquery ×1
replace ×1
rest ×1
string ×1
tomcat ×1
unit-testing ×1