从Maven的属性中获取分类器名称并将其用作变量的最简单方法是pom.xml什么?
例如:
<properties>
<final_jar>${project.build.finalName}-${classifier}.jar</final_jar>
</properties>
Run Code Online (Sandbox Code Playgroud)
官方文档中没有提及分类器属性.
看看maven-jar-plugin它的来源,它似乎是从一个被调用的属性中获取它,maven.jar.classifier但它似乎在插件之外不可用.有没有办法访问它?
在Mac OSX或Linux上可视化GraphML中定义的图形的最佳选项是什么?根据gremlin-users组, R + iGraph似乎是一个有效的解决方案,但我想知道是否有更简单的解决方案,理想情况下是一个简单的"graphml2png"命令行应用程序.任何的想法 ?
我尝试使用服务帐户访问Google Cloud Storage API时收到invalid_grant错误.我无法弄清楚以下代码有什么问题.任何的想法 ?这是我使用Google Storage API的第一个应用程序.任何帮助将不胜感激.
源代码
public static void main(String[] args) throws Exception {
HttpTransport httpTransport = new NetHttpTransport();
JsonFactory jsonFactory = new JacksonFactory();
List<String> scopes = new ArrayList<String>();
scopes.add(StorageScopes.DEVSTORAGE_FULL_CONTROL);
Credential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
.setJsonFactory(jsonFactory)
.setServiceAccountId("XXXX")
.setServiceAccountPrivateKeyFromP12File(new File("key.p12"))
.setServiceAccountScopes(scopes).build();
Storage storage = new Storage.Builder(httpTransport, jsonFactory,
credential).setApplicationName("test")
.build();
List<String> list = new ArrayList<String>();
List<Bucket> buckets = storage.buckets().list("XXXX").execute().getItems();
if(buckets != null) {
for(Bucket b : buckets) {
list.add(b.getName());
}
}
}
Run Code Online (Sandbox Code Playgroud)
错误和堆栈跟踪
Exception in thread "main" com.google.api.client.auth.oauth2.TokenResponseException: 400 …Run Code Online (Sandbox Code Playgroud)