首页 » 畏罪自爱

想用UsbWebServer搭建个临时server用来访问。十分方便。但是mysql要连接远程的
  1. 打开libra下的config.default.php ,更改如下:
$cfg['AllowArbitraryServer'] = false;修改成:$cfg['AllowArbitraryServer'] = true;

将$cfg['Servers'][$i]['host'] = '';你服务器的ip地址

将$cfg['Servers'][$i]['port'] = '';你服务器的端口

将$cfg['Servers'][$i]['user'] = 'root';你服务器的用户名

将$cfg['Servers'][$i]['password'] = '';你服务器的密码
  1. 打开phpmyadmin登陆的时候,注意server是带端口的。

重启云桌面后,云桌面中无法启动idea,原因是重启后,云桌面把相关agent文件删除了,解决办法就是每次启动创建这个文件。这里看idea报错,可以把idea.bat拖到cmd窗口,查看报错信息

解决思路:

  1. 把idea.bat拖到cmd框,报错如下:
Error opening zip file or JAR manifest missing : C:\Users\Public\.jetbrains\jetbrains-agent-v3.2.0.de72.619
Error occurred during initialization of VM
agent library failed to init: instrument

2.解决办法:

mkdir /c/Users/Public/.jetbrains/
cp jetbrains-agent.jar /c/Users/Public/.jetbrains/jetbrains-agent-v3.2.0.de72.619

maven 中如果一个module以来另一个模块的test class,需要使用maven-jar-plugin和classifier(最新的用type代替了)

1.项目a(被b以来的test class)

<project>
  <build>
    <plugins>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-jar-plugin</artifactId>
       <version>2.4</version>
       <executions>
         <execution>
           <goals>
             <goal>test-jar</goal>
           </goals>
         </execution>
       </executions>
     </plugin>
    </plugins>
  </build>
</project>

2.项目b,以来a中的test calss

<project>
  ...
  <dependencies>
    <dependency>
      <groupId>com.myco.app</groupId>
      <artifactId>foo</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  </dependencies>
  ...
</project> 

gradle项目越来越多,但是公司项目只能用maven,转换方法如下

1.每个项目的build.gradle(或者gradle.kts)加入插件

groovy:

plugins {
    id 'maven'
}

kotlin

plugins {
    maven
}

2.加入task

groovy


task writeNewPom {
    doLast {
        pom {
            project {
                inceptionYear '2008'
                licenses {
                    license {
                        name 'The Apache Software License, Version 2.0'
                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                        distribution 'repo'
                    }
                }
            }
        }.writeTo("$buildDir/newpom.xml")
    }
}

kotlin

task("writeNewPom") {
    doLast {
        maven.pom {
            withGroovyBuilder {
                "project" {
                    setProperty("inceptionYear", "2008")
                    "licenses" {
                        "license" {
                            setProperty("name", "The Apache Software License, Version 2.0")
                            setProperty("url", "http://www.apache.org/licenses/LICENSE-2.0.txt")
                            setProperty("distribution", "repo")
                        }
                    }
                }
            }
        }.writeTo("$buildDir/newpom.xml")
    }
}

3.gradle writeNewPom 运行即可

java.lang.NoSuchMethodError: io.swagger.models.AbstractModel.addProperty(Lja

最后发现是io.swagger:swagger-models:jar:1.6.0:和swager依赖的版本冲突,exclude掉

<dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.9.2</version>
            <exclusions>
                <exclusion>
                    <groupId>io.swagger</groupId>
                    <artifactId>swagger-models</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.swagger</groupId>
                    <artifactId>swagger-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.9.2</version>
            <exclusions>
                <exclusion>
                    <groupId>io.swagger</groupId>
                    <artifactId>swagger-models</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.swagger</groupId>
                    <artifactId>swagger-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>