Migrating unsigned Jobs on the Nexus repository
After upgrading Talend Administration Center, you need to migrate
the unsigned Jobs already published to the Nexus repository before you can execute them
in your new Talend Administration Center.
Before you begin
Procedure
Results
Troubleshooting: If the migration failed and no error message is displayed, try
following those steps.
- Log in to Nexus Repository Manager as admin.
- Click the Server Administration and Configuration button.
- Scroll down to the Update stored script by name API.
- Write search in the value of the name parameter.
- Paste the following search script in value of the
body parameter if you don't already have the search
script:
{ "name": "search", "content": "import org.sonatype.nexus.repository.storage.Query; import org.sonatype.nexus.repository.storage.StorageFacet; import org.sonatype.nexus.repository.storage.Query.Builder; import groovy.json.JsonOutput; import groovy.json.JsonSlurper; def search = new JsonSlurper().parseText(args); log.info('search arguments: ' + args); def repositoryId = search.repositoryId; def groupId = search.g; def artifactId = search.a; def version = search.v; def data = []; def repo = repository.repositoryManager.get(repositoryId); StorageFacet storageFacet = repo.facet(StorageFacet); def tx = storageFacet.txSupplier().get(); tx.begin(); def builder = Query.builder(); if(groupId != null){ builder.where('group = ').param(groupId); }; if(version != null){ if(builder.hasWhere()){ builder.and('version = ').param(version); }else{ builder.where('version = ').param(version); } }; if(artifactId != null){ artifactId =[artifactId]; log.info('artifactId: ' + artifactId); if(builder.hasWhere()){ builder.and('name in ').param(artifactId); }else{ builder.where('name in ').param(artifactId); } }; def query = builder.build() ; log.info('query: ' + query.getParameters()); log.info('query: ' + query.getWhere()); def components = tx.findComponents(query , [repo]); components.each{ ArtifactResult artifact = new ArtifactResult(); artifact.groupId = it.attributes().child('maven2').get('groupId'); artifact.artifactId = it.attributes().child('maven2').get('artifactId'); artifact.version = it.attributes().child('maven2').get('baseVersion'); artifact.extension = it.attributes().child('maven2').get('packaging'); artifact.last_updated = it.lastUpdated(); artifact.description = it.attributes().child('maven2').get('pom_description'); log.info('search arguments: ' + it.attributes()); log.info('search getProperties: ' + it.getProperties()); log.info('search getEntityMetadata: ' + it.getEntityMetadata()); log.info('search getMetaPropertyValues: ' + it.getMetaPropertyValues()); data << artifact; }; tx.commit(); tx.close(); return JsonOutput.toJson(data); class ArtifactResult{ String groupId; String artifactId; String version; String extension; String last_updated; String description; } ", "type": "groovy" }
- Click Try it out!.