我对Git很新,所以面对一些正确使用的问题.这是我的情景.
我有一个我的主存储库的分支,并将其克隆到我的本地.在那里,我有2个分支用于不同的修复.
当我提交时,我在git中看到了一个声明 - 我们说我提前3次提交,大约20次提交.
我知道我的fork与master不同步.另外我也需要合并两个分支(或者我应该这样做?)
我使用Windows客户端进行同步.但似乎我没有遵循Git的方式.所以,我尝试按照https://help.github.com/articles/syncing-a-fork/中描述的步骤进行操作,这给出了如下错误(我正在使用Windows).
$>git fetch upstream
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
我有点困惑.请帮助我在这个场景中应该遵循的步骤.
@HuStmpHrrr
很抱歉在评论中添加详细信息我会修改问题以便于阅读
通过执行命令:
$>git remote returning two values
acme-development (which the name of my actual/main repository, from where I forked) and
origin
Run Code Online (Sandbox Code Playgroud)
添加更多信息.
在获取之后,我尝试将origin/master合并到我的主人身上请查看截图
但是,如果我登录我的Github在线帐户,它会说一个不同的故事.
我的git客户端说本地仓库是最新的.但在线git表示,我们有42个提交,7个提交.
我们正在使用遗留项目(maven)来设置devop.初学者与詹金斯.Jenkins构建现在没有问题.但是,在将sonarqube与jenkins集成时,我们收到以下错误:
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Error when executing blame for file src/main/java/com/acme/acq/scavenger/AssetCmboItem.java
at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:100)
at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:59)
at org.sonar.batch.scm.ScmSensor.execute(ScmSensor.java:84)
at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:102)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:264)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:259)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:249)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.batch.scan.ProjectScanContainer.startComponents(ProjectScanContainer.java:127)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:274)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:165)
at …
Run Code Online (Sandbox Code Playgroud) 我正处于需要从多模块maven项目中构建胖罐的情况.该项目基于Selenium/cucumber API构建.
我的项目结构如下
Parent -- pom
|
|__core_module src/main/java --> helper classes for selenium
|
|__acme_module src/main/test --> Test Classes for acme project
Run Code Online (Sandbox Code Playgroud)
我尝试了不同的方法来构建一个"acme_test.jar",其中包括core_module + acme_module.But它们都没有帮助我.
非常感谢解决这个问题的任何线索.
谢谢
由于以下异常,我无法使用 cxf:cxf-codegen-plugin 从 WSDL 生成所需的源:
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.1.2:wsdl2java (generate-sources) on project innoclient: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.1.2:wsdl2java failed: Illegal character in opaque part at index 2: C:\WORK\BAG\WS\POC\innoclient/src/main/wsdl/mywsdl.wsdl -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.1.2:wsdl2java (generate-sources) on project innoclient: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.1.2:wsdl2java failed: Illegal character in opaque part at index 2: C:\WORK\WS\POC\src/main/wsdl/mywsdl.wsdl
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216) …
Run Code Online (Sandbox Code Playgroud) 我正在构建一个仪表板,旨在简化多个业务应用程序的使用。仪表板的主要工作是从这些应用程序中获取数据并将它们发送回经过身份验证的用户。仪表板分为使用框架 CakePHP3 编写的 API 和一个只执行 HTTP 请求的客户端(尚未编写,但计划在 angular(2+) 中)。
流程示例:我登录仪表板,它告诉我应用程序 A 中有 5 封未读电子邮件,应用程序 B 中有 3 个通知,应用程序 C 中有 5 个新文档。对于收到的每个数据,我有一个直接链接来访问目标业务应用程序中的这些数据。
为此,所有业务应用程序都被cassified(CAS客户端),仪表板充当代理CAS(经过身份验证的用户的身份被传输到cassified应用程序)。
我编写了一个 CakePHP3 插件来对 CAS 服务器进行身份验证。该插件很简单,如果我没有 CAS 会话(通过 phpCAS),它会将我重定向到 CAS。
在我的后端,我有一个端点允许我对业务应用程序进行代理请求,我们称之为 :(/api/business/:id
其中 :id 是应用程序的 ID)。这是我当前使用 phpCAS 执行此代理请求的代码:
if (!phpCAS::isAuthenticated()) {
throw new ForbiddenException('You need to be authenticated to the CAS server.');
}
$this->service = phpCAS::getProxiedService(PHPCAS_PROXIED_SERVICE_HTTP_GET);
$this->service->setUrl($this->url);
try {
$this->service->send();
$this->responseCode = $this->service->getResponseStatusCode();
$this->responseBody = $this->service->getResponseBody();
}
// willingly removed, not useful in this example
catch () …
Run Code Online (Sandbox Code Playgroud) 以下代码else
在解析之前不等待部件返回数据。
这段代码我哪里出错了?
return request.get(`${<URL1>}`)
.then((res) => {
if (res1.data[0]) {
data1 = res.data[0]};
} else {
request.get(`${<URL2>`)
.then((res2) => {
data1 = res2.data
});
}
return Promise.resolve(data1);
})
Run Code Online (Sandbox Code Playgroud)
提前致谢。
圣
我正在尝试在CQ中创建一个servlet来访问一些后端服务.然后从我的页面进行AJAX调用以获取servlet的响应.
@Component(immediate = true, metatype = false, label = "feedServlet")
@Service(Servlet.class)
@Properties(value = {
@org.apache.felix.scr.annotations.Property(name = "sling.servlet.methods", value = "POST"),
@org.apache.felix.scr.annotations.Property(name = "sling.servlet.resourceTypes", value ="/bin/feedServlet/"),
@org.apache.felix.scr.annotations.Property(name = "sling.servlet.selectors", value ="POST"),
@org.apache.felix.scr.annotations.Property(name = "sling.servlet.extensions", value ="html")
})
/**
* This servlet returns search results in json format.
*/
public class FeedServlet extends SlingAllMethodsServlet {
private static final long serialVersionUID = -2139716879248038562L;
/*
* Inject the service in to the servlet.
*/
// @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY, policy = ReferencePolicy.STATIC)
// private SearchService …
Run Code Online (Sandbox Code Playgroud) 我们正在使用 cqblueprints 原型来构建我们的 cq 项目(eclipse/cqblueprints)。但是在尝试部署 acme-corporate-services(包含捆绑包的项目)时,使用
mvn -Pauto-deploy install
Run Code Online (Sandbox Code Playgroud)
命令,我们收到以下错误。
[INFO] --- maven-bundle-plugin:2.3.7:install (default-install) @ acme-corporate-services ---
[INFO] Installing com/acme/wcm/cq/acme-corporate-services/1.0.0-SNAPSHOT/acme-corporate-services-1.0.0-SNAPSHOT.jar
[INFO] Writing OBR metadata
[INFO]
[INFO] --- maven-sling-plugin:2.1.0:install (install-bundle) @ acme-corporate-services ---
[INFO] Installing Bundle com.acme.wcm.cq.acme-corporate-services(C:\acme_CORP_REFACTOR\acme-corporate\acme-corporate-services\target\acme-corporate-services-1.0.0-SNAPSHOT.jar) to http://localhost:4502/apps/acme-corporate/install via PUT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.831 s
[INFO] Finished at: 2014-04-20T07:35:35-08:00
[INFO] Final Memory: 11M/42M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.sling:maven-sling-plugin:2.1.0:install (install-bundle) on project acme-corporate-services: Installation on http://localhost:4502/apps/acme-corporate/install failed, cause: Installation failed, cause: …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在nodejs 中创建一个lambda。根据文档,我创建了一个包含 lambda 函数、node_modules 和 package.json 的 zip 文件。我的 lambda zip 文件的结构如下:
my-lambda-function/
|
|---util/
| |
| |--util-1.js
| |--util-2.js
|---api/
| |
| |--api-call-1.js
| |--api-call-2.js
|
|---config
| |
| |--env/
| | |--env-file-1.js
| |
| |--config-file-1.js
| |--config-file-2.js
|
|---node_modules/
| |
| |--module-1/
| |--module-2/
|---index.js
|---package.json
Run Code Online (Sandbox Code Playgroud)
为了创建这个 zip 文件,我使用了 gulp 任务,
gulp.task('zip', ['test'], () => {
const buildArtifact = ['index.js', 'package.json', 'util/**',
'config/**', 'api/**'];
Object.keys(pjson.dependencies).forEach((dep) => {
buildArtifact.push(`node_modules/${dep}/**/*`);
});
const zipFile = `${pjson.name}.zip`; …
Run Code Online (Sandbox Code Playgroud) 在我们的CQ项目中,我们想要使用一些非osgi罐子.目前我们有一个单独的进程,而不是构建将这些jar转换为OSGi包(主要使用eclipse插件项目).但作为Maven构建本身的一部分,有没有一种完美的方法来处理它?这样整个过程对开发人员来说都是透明的[我在一些博客中看到了一些相关建议.但这也暗示要为此目的创建另一个项目.由于我们正在为项目使用多模块maven结构,是否建议添加一个模块来处理这些转换?].
如果你能给我一些指示,那会很有帮助.
感谢致敬,
圣
我们正在开发一个遗留项目,第一个任务是设置一个DevOps.重要的是我们对这个领域很新.
我们计划最初使用jenkins和sonarqube.让我从这些要求开始.
例如:该项目被细分为5个多模块maven项目,比如A,B,C,D和E.
1. A and C are completely independent and can be easly built
2. B depends on the artifact generated by A (jar) and has multiple maven profiles (say tomcat and websphere, it is a webservice module)
3. D depends on the artifact generated by C
4. E depends on A, B and D and has multiple maven profiles (say tomcat and websphere, it is a web project)
Run Code Online (Sandbox Code Playgroud)
基于jenkins文档来处理这种情况,我们正在考虑使用"参数化构建插件"和"扩展选择参数插件"参数化构建,借助这些插件,我们可以参数化配置文件名称.但在每次构建之前,构建器等待配置文件参数.
所以我们仍在寻找一个很好的解决方案
1. keep the dependency between …
Run Code Online (Sandbox Code Playgroud) 出于某种原因,我处于需要使用属性文件的情况:
1=1
2=2
3=3
4=4
5=5
6=6
7=7
12=12
13=13
14=14
15=15
16=16
17=17
23=23
24=24
25=25
26=26
27=27
34=34
35=35
36=36
37=37
45=45
46=46
47=47
56=56
57=57
67=67
123=123
124=124
125=125
126=126
.................
24567=24567
34567=34567
123456=123456
123457=123457
123467=123467
123567=123567
124567=124567
134567=134567
234567=234567
1234567=1234567
Run Code Online (Sandbox Code Playgroud)
我有实用程序处理程序类来对键进行排序
public class PropertyHandler {
private static PropertyHandler instance;
private Properties properties;
private PropertyHandler() {
InputStream fos = null;
try {
fos = PropertyHandler.class.getClassLoader().getResourceAsStream("dow-pattern.properties");
properties = new Properties() {
@Override
public Set<Object> keySet() {
return Collections.unmodifiableSet(new …
Run Code Online (Sandbox Code Playgroud) maven ×5
java ×4
aem ×3
jenkins ×2
angular ×1
aws-lambda ×1
axios ×1
build ×1
cakephp ×1
cas ×1
cxf ×1
devops ×1
eclipse ×1
git ×1
github ×1
javascript ×1
jwt ×1
node.js ×1
osgi ×1
osgi-bundle ×1
reactjs ×1
selenium ×1
servlet-3.0 ×1
sling ×1
sonarqube ×1
svn ×1
testing ×1
web-services ×1
wsdl2java ×1