SimpleCursorAdapter使用以下注释弃用其构造函数之一:
已过时.不鼓励使用此选项,因为它会导致在应用程序的UI线程上执行Cursor查询,从而导致响应能力较差甚至应用程序无响应错误.作为替代方案,使用android.app.LoaderManager和android.content.CursorLoader.
这是否会使整个班级弃用?不推荐使用其他(标准)构造函数.
我尝试使用exec-maven-plugin来运行Java程序.
我使用以下pom片段:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<executable>java</executable>
<arguments>
<argument>-Dmyproperty=myvalue</argument>
<argument>-cp</argument>
<argument>"/home/vogella/libs/*"</argument>
<argument>com.vogella.test.Main</argument>
</arguments>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
该类com.vogella.test.Main包含在一个jar文件中,该文件位于/ home/vogella/libs/*中.如果我运行该mvn -X clean install exec:exec命令,我看到以下错误消息:
[DEBUG]执行命令行:java -Dmyproperty = myvalue -cp"/ home/vogella/libs/*"com.vogella.test.Main错误:无法找到或加载主类com.vogella.test.Main
如果我java -Dmyproperty=myvalue -cp "/home/vogella/libs/*" com.vogella.test.Main在我启动Maven构建的shell中复制命令行(),那么Java程序将正确执行.
知道我的Maven设置有什么问题吗?