google-sheets-import-plugin Maven Mojo

Maven plugin to import data from Google Sheets into JSON files

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка
Группа

Группа

com.paf.maven
Идентификатор

Идентификатор

google-sheets-import-plugin
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

google-sheets-import-plugin Maven Mojo
Maven plugin to import data from Google Sheets into JSON files
Ссылка на сайт

Ссылка на сайт

https://github.com/pafoss/google-sheets-import-plugin
Система контроля версий

Система контроля версий

https://github.com/pafoss/google-sheets-import-plugin

Скачать google-sheets-import-plugin

Как подключить последнюю версию

<plugin>
    <groupId>com.paf.maven</groupId>
    <artifactId>google-sheets-import-plugin</artifactId>
    <version>1.1.0</version>
</plugin>

Зависимости

compile (8)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-core jar 3.6.0
org.apache.maven : maven-plugin-api jar 3.6.0
com.google.api-client : google-api-client jar 1.30.9
com.google.auth : google-auth-library-oauth2-http jar 0.20.0
com.google.apis : google-api-services-sheets jar v4-rev612-1.25.0
com.fasterxml.jackson.module : jackson-module-kotlin jar 2.10.3
org.jetbrains.kotlin : kotlin-reflect jar 1.3.72
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.72

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.6.0

test (1)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-test-junit jar 1.3.72

Модули Проекта

Данный проект не имеет модулей.

google-sheets-import-plugin

Maven plugin that automatically imports data from Google Sheets into the project.

Given a Google Spreadsheet ID, it will create one JSON file for each sheet of the document on the specified output path. This plugin assumes that the spreadsheets are data grids where the first row are the column headers.

Configuration

Google API service account

In order to be able to access your spreadsheet, you need to create a Google APIs service account.

  • Create a project at https://console.developers.google.com/apis/dashboard
  • Make sure that the Google Sheets API is enabled by clicking on "Enable APIs and services"
  • Go to Credentials -> Create credentials -> Service Account and create a new one.
  • Once the service account has been created, create a new key and download the JSON file. You can use this JSON file to configure the googleApiCredentialsFile configuration property of this plugin.

Plugin setup

Include the following configuration into your pom.xml file:

<build>
    <plugins>
        <plugin>
            <groupId>com.paf.maven</groupId>
            <artifactId>google-sheets-import-plugin</artifactId>
            <version>1.0</version>
            <executions>
                <execution>
                    <id>compile</id>
                    <phase>generate-resources</phase>
                    <goals>
                        <goal>import-sheets</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <outputDirectory>${project.build.directory}/resources</outputDirectory>
                <googleSheetId>${your_google_sheet_id}</googleSheetId>
                <googleApiCredentialsFile>${project.basedir}/credentials.json</googleApiCredentialsFile>
                <prettyPrint>true</prettyPrint>
            </configuration>
        </plugin>
    </plugins>
</build>

Granting access to your spreadsheet

Make sure that your spreadsheet is either publicly visible or your service account has access to it. The Google APIs service accounts are created with an email address associated to it in the format service-account-name@project-id.iam.gserviceaccount.com. Sharing the document with that address with read-only permissions will suffice.

com.paf.maven

Paf Open Source

Версии библиотеки

Версия
1.1.0
1.0.0
0.0.5