小编DP_*_*DP_的帖子

生命周期配置未涵盖的插件执行:com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources

我有一个Android应用程序,它是使用pom.xml下面给出的文件构建的. mvn clean install工作没有错误,但在Eclipse中我得到以下错误:

Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources (execution: default-generate-sources, phase: generate-sources)
Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:proguard (execution: default-proguard, phase: process-classes)
Run Code Online (Sandbox Code Playgroud)

我该如何解决这些问题?

这是pom.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycompany</groupId>
    <artifactId>myapp-android</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>apk</packaging>
    <name>myappAndroidClient</name>

    <repositories>
        <repository>
            <id>achartengine</id>
            <name>Public AChartEngine repository</name>
            <url>https://repository-achartengine.forge.cloudbees.com/snapshot/</url>
        </repository>       
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <version>4.1.1.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>compile</scope>
        </dependency>
        <!-- Make sure this (robolectric dependency) is below the …
Run Code Online (Sandbox Code Playgroud)

java eclipse android maven-3 maven

17
推荐指数
1
解决办法
1万
查看次数

TFS中有本地提交吗?

TFS是否支持本地提交?

换句话说:我可以

  1. 修改代码,
  2. 进行本地提交(不与他人共享这些更改),
  3. 测试我的修改和
  4. 如果我的更改没有破坏任何内容,请执行全局提交(此后我的更改可供其他开发人员使用)

在TFS 2012?

如果没有,是否有任何解决方法,允许此功能?

tfs tfs2012

16
推荐指数
2
解决办法
8270
查看次数

osm2pgsql:函数AddGeometryColumn不存在

我想使用Osm2pgsql工具将OSM文件导入我的PostgreSQL数据库(Windows,Postgres版本9.2).

当我运行以下命令

osm2pgsql.exe --create -d mydb artyom.xml -U myuser -W --style default.style
Run Code Online (Sandbox Code Playgroud)

我收到了错误

SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, 'POINT', 2 );
 failed: FEHLER:  Funktion addgeometrycolumn(unknown, unknown, integer, unknown,
 integer) existiert nicht
LINE 1: SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, ...
               ^
HINT:  Keine Funktion stimmt mit dem angegebenen Namen und den Argumenttypen ??b
erein. Sie m??ssen m?Âglicherweise ausdr??ckliche Typumwandlungen hinzuf??gen.

Error occurred, cleaning up
Run Code Online (Sandbox Code Playgroud)

德语翻译:

SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, 'POINT', 2 );
 failed: ERROR:  Function addgeometrycolumn(unknown, unknown, integer, unknown, …
Run Code Online (Sandbox Code Playgroud)

postgresql postgis openstreetmap postgresql-9.2

15
推荐指数
1
解决办法
2万
查看次数

'release'不可用:在自动参考计数模式下不可用

我正在学习如何使用"Head first iPhone and iPad development"(第二版)这本书在iOS操作系统上进行编程.

截图

当我尝试编译本书中的代码时,我得到错误,即release在引用计数模式下不允许使用use 关键字.

在这种情况下,我是否必须明确释放内存?如果是 - 如何?

objective-c ios

15
推荐指数
2
解决办法
4万
查看次数

为什么在此GraphQL设置中未调用DataFetcher?

我想编写一段代码,它将处理如下的GraphQL查询:

  query {
      group(id: "com.graphql-java")
      name(name: "graphql-java")
      version(id: "2.3.0")
  }
Run Code Online (Sandbox Code Playgroud)

我已经创建了一个数据获取器并在get方法中放置了一个断点:

  import graphql.schema.DataFetcher;
  import graphql.schema.DataFetchingEnvironment;

  public class TestDataFetcher implements DataFetcher {
      public Object get(final DataFetchingEnvironment dataFetchingEnvironment) {
          return null;
      }
  }
Run Code Online (Sandbox Code Playgroud)

然后我写了下面的代码:

  public class Example02 {
      public static void main(final String[] args) throws IOException {
          final Example02 app = new Example02();
          app.run();
      }
      void run() throws IOException {
          final TestDataFetcher testDataFetcher = new TestDataFetcher();

          final List<GraphQLFieldDefinition> fields = Lists.newArrayList(
                  createGroupField(testDataFetcher),
                  createNameField(),
                  createVersionField());

          final GraphQLObjectType queryType = newObject()
                  .name("query") …
Run Code Online (Sandbox Code Playgroud)

java graphql graphql-java

14
推荐指数
1
解决办法
1880
查看次数

ProGuard不会使依赖项混淆JAR

我有一个项目与pom.xml下面给出的文件.当我发出命令时,mvn clean compile assembly:single install我希望Maven生成一个包含的JAR

  • 所有的依赖和
  • 我代码的混淆版本.

它不起作用 - 我的代码在"jar-with-dependencies"文件中没有被混淆.

当我运行mvn clean compile install生成的文件包含我的应用程序的模糊代码,但没有依赖项.

为了获得包含所有依赖项和混淆代码的JAR文件,我该怎么办?

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mycompany</groupId>
    <artifactId>myproduct</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <restlet-version>2.3.5</restlet-version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.spongepowered</groupId>
            <artifactId>spongeapi</artifactId>
            <version>3.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
        <dependency>
            <groupId>org.easytesting</groupId>
            <artifactId>fest-assert-core</artifactId>
            <version>2.0M8</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>1.10.19</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.restlet.jse</groupId>
            <artifactId>org.restlet</artifactId>
            <version>${restlet-version}</version>
        </dependency>
        <dependency>
            <groupId>org.restlet.jse</groupId>
            <artifactId>org.restlet.ext.jackson</artifactId>
            <version>${restlet-version}</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1.1</version>
        </dependency>
    </dependencies>
    <build>
        <resources>
            <resource> …
Run Code Online (Sandbox Code Playgroud)

java obfuscation proguard maven-3 maven

12
推荐指数
1
解决办法
6004
查看次数

ST_Distance的返回值单位

我需要计算它们之间的距离

  1. 所有的建筑和
  2. 所有医院

在从OSM导入的地图中.

我使用以下查询:

SELECT building_id, hospital_id, ST_Distance(building_centroid, hospital_location)
FROM 
(
select planet_osm_polygon.osm_id building_id, ST_Centroid(planet_osm_polygon.way) building_centroid
from planet_osm_polygon
where building = 'yes'
) buildings,
(
select planet_osm_point.osm_id hospital_id, planet_osm_point.way hospital_location
from planet_osm_point  
where amenity = 'hospital') hospitals
Run Code Online (Sandbox Code Playgroud)

我得到奇怪的结果 - 距离总是小于1.

我怎样才能了解报告这些值的单位?

更新1:示例结果:

上面查询的示例结果

更新2:此查询似乎有效

SELECT building_id, hospital_id, ST_Distance_sphere(building_centroid, hospital_location) distance
FROM 
(
select planet_osm_polygon.osm_id building_id, ST_Centroid(planet_osm_polygon.way)  building_centroid
from planet_osm_polygon
where building = 'yes'
) buildings,
(
select planet_osm_point.osm_id hospital_id, planet_osm_point.way hospital_location
from planet_osm_point  
where amenity = 'hospital') hospitals …
Run Code Online (Sandbox Code Playgroud)

postgresql postgis postgresql-9.2

11
推荐指数
1
解决办法
8354
查看次数

内部服务器错误500.24

我正在尝试在IIS Express中运行Visual Studio 2013 Express for Web中的ASP.NET项目.

当我启动它时,我在浏览器中看到以下消息:

截图

德语翻译:ASP.NET设置被识别,在"集成"管理管道模式中无效.可能原因:"system.web/identity@impersonate"设置为"true".

我怎样才能解决这个问题?

更新1: "属性"面板:

属性面板

asp.net iis visual-studio iis-express visual-studio-2013

11
推荐指数
2
解决办法
1万
查看次数

EasyMock中Mockito.spy/doReturn的类比是什么?

想象一下,我有以下课程:

public class TestClass {
    public class Index<X> {

    }
    public class IndexData {
        private final Index<?> index;

        private final ReentrantReadWriteLock lock =
            new ReentrantReadWriteLock();

        public IndexData(final Index<?> index) {
            super();
            this.index = index;
        }

        public Index<?> getIndex() {
            return index;
        }

        public Lock getReadLock() {
            return lock.readLock();
        }

        public Lock getWriteLock() {
            return lock.writeLock();
        }   
    }

    public void add(final InputClass input)
    {
        final IndexData index = getIndex(input);

        final Lock lock = index.getWriteLock();
        lock.lock();
        try {
            // Do something here, …
Run Code Online (Sandbox Code Playgroud)

java unit-testing easymock mocking mockito

11
推荐指数
1
解决办法
4500
查看次数

在这段代码中,变量如何为空?

FindBugs抱怨在此方法中Comparator.compareStrings(String,String)可能不可行的分支上的str1的可能空指针解除引用:

private static int compareStrings(final String str1, final String str2) {
    if ((str1 == null) && (str2 == null)) {
        return COMPARE_ABSENT;
    }
    if ((str1 == null) && (str2 != null)) {
        return COMPARE_DIFFERS;
    }
    if ((str1 != null) && (str2 == null)) {
        return COMPARE_DIFFERS;
    }
    return str1.equals(str2) ? COMPARE_EQUALS : COMPARE_DIFFERS;
}
Run Code Online (Sandbox Code Playgroud)

在Eclipse中,我还在最后一行看到警告(str1可能为null).

在什么情况下可以str1nullreturn str1.equals(str2) ? COMPARE_EQUALS : COMPARE_DIFFERS;(鉴于前两个if块覆盖的情况下,当str1为null)?

java findbugs

11
推荐指数
1
解决办法
155
查看次数